Skip to content

Commit

Permalink
use post_renderer when checking 'changed' status for a helm release
Browse files Browse the repository at this point in the history
`helmdiff_check` needs to use --post-renderer if configured in order
to detect changes correctly
  • Loading branch information
pauvos committed Feb 20, 2023
1 parent 31c1ccf commit a2ec37d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- helm - use post_renderer when checking 'changed' status for a helm release (https://github.com/ansible-collections/kubernetes.core/pull/588).
4 changes: 4 additions & 0 deletions plugins/modules/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ def helmdiff_check(
chart_version=None,
replace=False,
chart_repo_url=None,
post_renderer=False,
):
"""
Use helm diff to determine if a release would change by upgrading a chart.
Expand All @@ -645,6 +646,8 @@ def helmdiff_check(
cmd += " " + "--version=" + chart_version
if not replace:
cmd += " " + "--reset-values"
if post_renderer:
cmd += " --post-renderer=" + post_renderer

if release_values != {}:
fd, path = tempfile.mkstemp(suffix=".yml")
Expand Down Expand Up @@ -884,6 +887,7 @@ def main():
chart_version,
replace,
chart_repo_url,
post_renderer,
)
if would_change and module._diff:
opt_result["diff"] = {"prepared": prepared}
Expand Down

0 comments on commit a2ec37d

Please sign in to comment.