helm_template: change order of values_release and values_files (#373)

helm_template: change order of values_release and values_files

SUMMARY
This fix aligns precedence of release_values and values_files in kubernetes.core.helm_template with the one in kubernetes.core.helm.
The values in release_values are now processed last, thus with the highest precedence.
This allows overwriting of values in values_files with the values presented in release_values.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
changelogs/fragments/348-helm_template-fix-precedence-of-release-values-over-values-files.yaml
plugins/modules/helm_template.py
tests/unit/modules/test_helm_template.py
This commit is contained in:
Abhijeet Kasurde
2022-02-09 21:17:17 +05:30
committed by GitHub
parent dde6eb3c06
commit 82565dad78
3 changed files with 49 additions and 4 deletions

View File

@@ -152,16 +152,16 @@ def template(
if output_dir:
cmd += " --output-dir=" + output_dir
if values_files:
for values_file in values_files:
cmd += " -f=" + values_file
if release_values:
fd, path = tempfile.mkstemp(suffix=".yml")
with open(path, "w") as yaml_file:
yaml.dump(release_values, yaml_file, default_flow_style=False)
cmd += " -f=" + path
if values_files:
for values_file in values_files:
cmd += " -f=" + values_file
if include_crds:
cmd += " --include-crds"