From 835fc8dcf339bfb773b4e72c784aa0f0eab0066b Mon Sep 17 00:00:00 2001 From: test Date: Wed, 5 Feb 2025 14:49:23 -0600 Subject: [PATCH 1/2] updating helm version regex for more support --- plugins/module_utils/helm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/helm.py b/plugins/module_utils/helm.py index 331c9ad718..1b4ad66992 100644 --- a/plugins/module_utils/helm.py +++ b/plugins/module_utils/helm.py @@ -185,7 +185,7 @@ def get_helm_binary(self): def get_helm_version(self): command = self.get_helm_binary() + " version" rc, out, err = self.run_command(command) - m = re.match(r'version.BuildInfo{Version:"v(.*?)",', out) + m = re.match(r'version.BuildInfo{Version:"v?(.*?)",', out) if m: return m.group(1) m = re.match(r'Client: &version.Version{SemVer:"v(.*?)", ', out) From 9e2a58bde5bd2bff551d0f290e34586e2e32b94c Mon Sep 17 00:00:00 2001 From: test Date: Thu, 6 Feb 2025 09:57:27 -0600 Subject: [PATCH 2/2] adding unit test --- tests/unit/module_utils/test_helm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/module_utils/test_helm.py b/tests/unit/module_utils/test_helm.py index ec181b2d93..bbd2926022 100644 --- a/tests/unit/module_utils/test_helm.py +++ b/tests/unit/module_utils/test_helm.py @@ -204,6 +204,10 @@ def test_module_get_values(_ansible_helm_module, no_values, get_all): 'version.BuildInfo{Version:"v3.15.0-rc.1", GitCommit:"d7afa3b6b432c09a02cd07342e908ba5bed34940", GitTreeState:"clean", GoVersion:"go1.22.4"}', "3.15.0-rc.1", ), + ( + 'version.BuildInfo{Version:"3.10.3", GitCommit:7870ab3ed4135f136eec, GoVersion:"go1.18.9"}', + "3.10.3", + ), ('Client: &version.Version{SemVer:"v3.12.3", ', "3.12.3"), ('Client: &version.Version{SemVer:"v3.12.3"', None), ],