CORD-3048 Unit Tests for Kubernetes Synchronizer
Change-Id: I0ff9146d544a2e0a212264b7d366500d6a51ff1c
diff --git a/xos/synchronizer/pull_steps/pull_pods.py b/xos/synchronizer/pull_steps/pull_pods.py
index b1cc71d..3cbbbce 100644
--- a/xos/synchronizer/pull_steps/pull_pods.py
+++ b/xos/synchronizer/pull_steps/pull_pods.py
@@ -25,8 +25,6 @@
from xosconfig import Config
from multistructlog import create_logger
-from kubernetes import client as kubernetes_client, config as kubernetes_config
-
log = create_logger(Config().get('logging'))
class KubernetesServiceInstancePullStep(PullStep):
@@ -40,7 +38,10 @@
def __init__(self):
super(KubernetesServiceInstancePullStep, self).__init__(observed_model=KubernetesServiceInstance)
+ self.init_kubernetes_client()
+ def init_kubernetes_client(self):
+ from kubernetes import client as kubernetes_client, config as kubernetes_config
kubernetes_config.load_incluster_config()
self.v1core = kubernetes_client.CoreV1Api()
self.v1apps = kubernetes_client.AppsV1Api()