From f20004d196cd746ecc06660dceed071a18446825 Mon Sep 17 00:00:00 2001 From: Yuriy Novostavskiy Date: Wed, 11 Dec 2024 16:51:30 +0000 Subject: [PATCH] consider support helm < 3.0.0 --- plugins/module_utils/helm.py | 3 +++ plugins/modules/helm_registry_auth.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/module_utils/helm.py b/plugins/module_utils/helm.py index 331c9ad718..f36fe79de9 100644 --- a/plugins/module_utils/helm.py +++ b/plugins/module_utils/helm.py @@ -151,6 +151,9 @@ def _prepare_helm_environment(self): env_update["KUBECONFIG"] = kubeconfig_path self.add_cleanup_file(kubeconfig_path) + if LooseVersion(self.get_helm_version()) < LooseVersion("3.0.0"): + env_update["HELM_EXPERIMENTAL_OCI"] = "1" + return env_update @property diff --git a/plugins/modules/helm_registry_auth.py b/plugins/modules/helm_registry_auth.py index 62bcef9e63..058f518a81 100644 --- a/plugins/modules/helm_registry_auth.py +++ b/plugins/modules/helm_registry_auth.py @@ -223,10 +223,10 @@ def main(): else: module.fail_json( msg="Failure when executing Helm command. Exited {0}.\nstdout: {1}\nstderr: {2}".format( - rc, out, err - ), - command=helm_cmd, - ) + rc, out, err + ), + command=helm_cmd, + ) module.exit_json(changed=changed, stdout=out, stderr=err, command=helm_cmd)