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 <davlet.panech@windriver.com>
Change-Id: Ic92d7792f4a1baf374e9e8ce25b88d6aee7d2b62
This commit is contained in:
Davlet Panech 2023-02-08 12:36:49 -05:00
parent 16dd9d0a78
commit 714bb7cbf6
2 changed files with 5 additions and 2 deletions

View File

@ -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 --'

View File

@ -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)