Skip to content

Commit

Permalink
fix: improve versions checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bidorffOL committed Dec 17, 2024
1 parent 847d64a commit aaee3dd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions plugins/modules/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ def deploy(
deploy_command += " --reuse-values=" + str(reuse_values)

if reset_then_reuse_values:
helm_diff_version = get_plugin_version("diff")
if LooseVersion(helm_diff_version) < LooseVersion("3.9.12"):
module.warn("helm diff support option --reset-then-reuse-values starting release >= 3.9.12")
helm_version = module.get_helm_version()
if LooseVersion(helm_version) < LooseVersion("3.14.0"):
module.warn("helm support option --reset-then-reuse-values starting release >= 3.14.0")
else:
deploy_command += " --reset-then-reuse-values"

Expand Down Expand Up @@ -696,7 +696,14 @@ def helmdiff_check(
cmd += " --reuse-values"

if reset_then_reuse_values:
cmd += " --reset-then-reuse-values"
helm_diff_version = get_plugin_version("diff")
helm_version = module.get_helm_version()
if LooseVersion(helm_diff_version) < LooseVersion("3.9.12"):
module.warn("helm diff support option --reset-then-reuse-values starting release >= 3.9.12")
elif LooseVersion(helm_version) < LooseVersion("3.14.0"):
module.warn("helm support option --reset-then-reuse-values starting release >= 3.14.0")
else:
cmd += " --reset-then-reuse-values"

rc, out, err = module.run_helm_command(cmd)
return (len(out.strip()) > 0, out.strip())
Expand Down

0 comments on commit aaee3dd

Please sign in to comment.