Skip to content

Commit

Permalink
sanity + integration test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
abikouo committed Nov 29, 2022
1 parent fd2ef5c commit a0fa11a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 9 additions & 7 deletions plugins/modules/helm_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ def __init__(self, module):
release_revision = module.params.get("release_revision")
release_namespace = module.params.get("release_namespace")

self.common_options = ""
common_options = []
if release_revision:
self.common_options += f" --revision {release_revision}"
common_options.append("--revision " + release_revision)

if release_revision:
self.common_options += f" --namespace {release_namespace}"
common_options.append("--namespace " + release_namespace)

self.common_options = " ".join(common_options)

def parse_yaml_content(self, content):

Expand All @@ -172,7 +174,7 @@ def parse_yaml_content(self, content):
def hooks(self):

rc, out, err = run_helm(
self.module, self.helm_cmd + f" hooks {self.name}" + self.common_options
self.module, self.helm_cmd + f" hooks {self.name} " + self.common_options
)
if rc != 0:
self.module.fail_json(msg=err)
Expand All @@ -182,7 +184,7 @@ def values(self):

command = (
self.helm_cmd
+ f" values {self.name}"
+ f" values {self.name} "
+ self.common_options
+ " --output json"
)
Expand All @@ -199,7 +201,7 @@ def values(self):
def manifest(self):

rc, out, err = run_helm(
self.module, self.helm_cmd + f" manifest {self.name}" + self.common_options
self.module, self.helm_cmd + f" manifest {self.name} " + self.common_options
)
if rc != 0:
self.module.fail_json(msg=err)
Expand All @@ -208,7 +210,7 @@ def manifest(self):
def notes(self):

rc, out, err = run_helm(
self.module, self.helm_cmd + f" notes {self.name}" + self.common_options
self.module, self.helm_cmd + f" notes {self.name} " + self.common_options
)
if rc != 0:
self.module.fail_json(msg=err)
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/targets/helm/tasks/tests_chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@
# Test helm set
- name: Install helm using set_values parameters
kubernetes.core.helm:
binary_path: "{{ helm_binary }}"
chart_ref: mariadb
chart_repo_url: https://charts.bitnami.com/bitnami
release_name: test-mariadb
Expand All @@ -426,6 +427,7 @@

- name: Get value set as string
kubernetes.core.helm_get:
binary_path: "{{ helm_binary }}"
release_name: test-mariadb
release_namespace: "{{ helm_namespace }}"
release_info:
Expand Down

0 comments on commit a0fa11a

Please sign in to comment.