From 2a40c59d53b1a147f76f30bf9f2102c8a9c60e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 6 Dec 2020 00:19:52 +0100 Subject: [PATCH] do not Kubernetes in dev mode --- src/kuberclient.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/kuberclient.py b/src/kuberclient.py index 4919f69..21e0a00 100644 --- a/src/kuberclient.py +++ b/src/kuberclient.py @@ -10,6 +10,7 @@ __module_name__ = "kuberclient" __version__text__ = "1" from kubernetes import client, config +from config import RELEASEMODE class Kubectl: @@ -102,15 +103,18 @@ class Kubectl: core_v1_api.create_namespaced_service(namespace="videon", body=body, name=self.name) def create_resource(self): - self.__create_configmap() - self.__create_deployment() - self.__create_service() + if RELEASEMODE != "dev": + self.__create_configmap() + self.__create_deployment() + self.__create_service() def update_resource(self): - self.__update_configmap() - self.__delete_pod() + if RELEASEMODE != "dev": + self.__update_configmap() + self.__delete_pod() def delete_resource(self): - self.__delete_deployment() - self.__delete_configmap() - self.__delete_service() + if RELEASEMODE != "dev": + self.__delete_deployment() + self.__delete_configmap() + self.__delete_service()