stx control stop --wait: helm compatibility

Don't use --wait with helm uninstall because it requires helm >= 3.7,
and even in those versions doesn't work correctly.

Story: 2011038
Task: 49549

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I4f3be32bf4ce84e1670e7884fc09c3ddac00b85a
This commit is contained in:
Davlet Panech 2024-02-16 08:23:07 -05:00
parent 4187e73f86
commit f5ddd163a1

View File

@ -276,12 +276,12 @@ stx-pkgbuilder/configmap/')
self.configurePulp() self.configurePulp()
def handleStopTask(self, projectname, wait): def handleStopTask(self, projectname, wait):
# "helm uninstall --wait" doesn't work, except in very recent helm versions # "helm uninstall --wait" requires version >= 3.7, and is broken
# see https://github.com/helm/helm/issues/10586 # in some versions:
# https://github.com/helm/helm/issues/10586
# https://github.com/helm/helm/pull/11479 # https://github.com/helm/helm/pull/11479
# #
# In case helm returned too early, we will loop until there are no pods left, # Workaround: loop until there are no pods left, after "helm uninstall".
# after "helm uninstall".
# Use Helm's own default timeout of 5 minutes # Use Helm's own default timeout of 5 minutes
timeout = 5 * 60 timeout = 5 * 60
@ -289,7 +289,7 @@ stx-pkgbuilder/configmap/')
helm_status = self.k8s.helm_release_exists(self.projectname) helm_status = self.k8s.helm_release_exists(self.projectname)
if helm_status: if helm_status:
cmd = f'{self.config.helm()} uninstall {projectname} --wait' cmd = f'{self.config.helm()} uninstall {projectname}'
self.logger.debug('Execute the helm stop command: %s', cmd) self.logger.debug('Execute the helm stop command: %s', cmd)
subprocess.check_call(cmd, shell=True) subprocess.check_call(cmd, shell=True)
else: else: