From 714bb7cbf677d703b85f81a4361b02e8b348eeb8 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Wed, 8 Feb 2023 12:36:49 -0500 Subject: [PATCH] Avoid minikube profile interference The "stx" script calls helm without specifying which minikube profile to use, so it ends up using whichever profile was started last. TESTS ============================= * Create 2 different build environments * Make sure "stx-init-env" and "stx control start/stop/status" don't interfere with each other in different environments Closes-Bug: 2006622 Signed-off-by: Davlet Panech Change-Id: Ic92d7792f4a1baf374e9e8ce25b88d6aee7d2b62 --- stx/lib/stx/config.py | 5 ++++- stx/lib/stx/stx_control.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stx/lib/stx/config.py b/stx/lib/stx/config.py index 2b40be32..70e444bd 100644 --- a/stx/lib/stx/config.py +++ b/stx/lib/stx/config.py @@ -131,7 +131,10 @@ class Config: def _init_kubectl_cmd(self): # helm - self.helm_cmd = 'helm' + if self.use_minikube: + self.helm_cmd = f'helm --kube-context {self.minikube_profile}' + else: + self.helm_cmd = 'helm' # kubectl if self.use_minikube: self.kubectl_cmd = f'minikube -p {self.minikube_profile} kubectl --' diff --git a/stx/lib/stx/stx_control.py b/stx/lib/stx/stx_control.py index 76e2552b..c5a75523 100644 --- a/stx/lib/stx/stx_control.py +++ b/stx/lib/stx/stx_control.py @@ -208,7 +208,7 @@ stx-pkgbuilder/configmap/') os.system(cmd) # Update the dependency charts - cmd = 'helm dependency update ' + self.abs_helmchartdir + cmd = self.config.helm() + ' dependency update ' + self.abs_helmchartdir self.logger.debug('Dependency build command: %s', cmd) subprocess.call(cmd, shell=True)