mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
Return diff in helm check mode (#290)
Return diff in helm check mode When the helm module is executed in check mode with the helm diff plugin installed, it now returns the diff. SUMMARY When the helm module is executed in check mode with the helm diff plugin installed, it now returns the diff. COMPONENT NAME helm ADDITIONAL INFORMATION Reviewed-by: Abhijeet Kasurde <None> Reviewed-by: Fabrice <None> Reviewed-by: Mike Graves <mgraves@redhat.com> Reviewed-by: None <None>
This commit is contained in:
@@ -537,7 +537,7 @@ def helmdiff_check(
|
||||
cmd += " -f=" + values_file
|
||||
|
||||
rc, out, err = run_helm(module, cmd)
|
||||
return len(out.strip()) > 0
|
||||
return (len(out.strip()) > 0, out.strip())
|
||||
|
||||
|
||||
def default_check(release_status, chart_info, values=None, values_files=None):
|
||||
@@ -725,7 +725,7 @@ def main():
|
||||
else:
|
||||
|
||||
if has_plugin(helm_cmd_common, "diff") and not chart_repo_url:
|
||||
would_change = helmdiff_check(
|
||||
(would_change, prepared) = helmdiff_check(
|
||||
module,
|
||||
helm_cmd_common,
|
||||
release_name,
|
||||
@@ -735,6 +735,8 @@ def main():
|
||||
chart_version,
|
||||
replace,
|
||||
)
|
||||
if would_change and module._diff:
|
||||
opt_result["diff"] = {"prepared": prepared}
|
||||
else:
|
||||
module.warn(
|
||||
"The default idempotency check can fail to report changes in certain cases. "
|
||||
|
||||
Reference in New Issue
Block a user