Skip to content

Commit

Permalink
Add validate argument to helm_template
Browse files Browse the repository at this point in the history
  • Loading branch information
pauvos committed Feb 18, 2023
1 parent 31c1ccf commit 71e9d81
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plugins/modules/helm_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
type: list
elements: str
version_added: 2.4.0
validate:
description:
- Validate your manifests against the Kubernetes cluster you are currently pointing at. This is the same validation performed on an install.
required: false
type: bool
default: false
values_files:
description:
- Value files to pass to chart.
Expand Down Expand Up @@ -226,6 +232,7 @@ def template(
release_values=None,
values_files=None,
include_crds=False,
validate=False,
set_values=None,
):
cmd += " template "
Expand Down Expand Up @@ -270,6 +277,9 @@ def template(
if include_crds:
cmd += " --include-crds"

if validate:
cmd += " --validate"

if set_values:
cmd += " " + set_values

Expand All @@ -291,6 +301,7 @@ def main():
release_namespace=dict(type="str"),
release_values=dict(type="dict", default={}, aliases=["values"]),
show_only=dict(type="list", default=[], elements="str"),
validate=dict(type="bool", default=False),
values_files=dict(type="list", default=[], elements="str"),
update_repo_cache=dict(type="bool", default=False),
set_values=dict(type="list", elements="dict"),
Expand All @@ -310,6 +321,7 @@ def main():
show_only = module.params.get("show_only")
release_namespace = module.params.get("release_namespace")
release_values = module.params.get("release_values")
validate = module.params.get("validate")
values_files = module.params.get("values_files")
update_repo_cache = module.params.get("update_repo_cache")
set_values = module.params.get("set_values")
Expand Down Expand Up @@ -341,6 +353,7 @@ def main():
show_only=show_only,
values_files=values_files,
include_crds=include_crds,
validate=validate,
set_values=set_values_args,
)

Expand Down

0 comments on commit 71e9d81

Please sign in to comment.