Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Helm post-renderer #403

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/30-helm-add-post-renderer-support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- helm - add support for post-renderer flag (https://github.com/ansible-collections/kubernetes.core/issues/30).
13 changes: 13 additions & 0 deletions plugins/modules/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
type: bool
default: False
version_added: "0.11.1"
post_renderer:
description:
- Path to an executable to be used for post rendering.
type: str
version_added: "2.4.0"
replace:
description:
- Reuse the given name, only if that name is a deleted release which remains in the history.
Expand Down Expand Up @@ -405,6 +410,7 @@ def deploy(
atomic=False,
create_namespace=False,
replace=False,
post_renderer=None,
skip_crds=False,
timeout=None,
):
Expand Down Expand Up @@ -453,6 +459,9 @@ def deploy(
yaml.dump(release_values, yaml_file, default_flow_style=False)
deploy_command += " -f=" + path

if post_renderer:
deploy_command = " --post-renderer=" + post_renderer
mnaser marked this conversation as resolved.
Show resolved Hide resolved

if skip_crds:
deploy_command += " --skip-crds"

Expand Down Expand Up @@ -615,6 +624,7 @@ def main():
timeout=dict(type="str"),
atomic=dict(type="bool", default=False),
create_namespace=dict(type="bool", default=False),
post_renderer=dict(type="str"),
replace=dict(type="bool", default=False),
skip_crds=dict(type="bool", default=False),
history_max=dict(type="int"),
Expand Down Expand Up @@ -671,6 +681,7 @@ def main():
wait_timeout = module.params.get("wait_timeout")
atomic = module.params.get("atomic")
create_namespace = module.params.get("create_namespace")
post_renderer = module.params.get("post_renderer")
replace = module.params.get("replace")
skip_crds = module.params.get("skip_crds")
history_max = module.params.get("history_max")
Expand Down Expand Up @@ -731,6 +742,7 @@ def main():
values_files=values_files,
atomic=atomic,
create_namespace=create_namespace,
post_renderer=post_renderer,
replace=replace,
skip_crds=skip_crds,
history_max=history_max,
Expand Down Expand Up @@ -783,6 +795,7 @@ def main():
values_files=values_files,
atomic=atomic,
create_namespace=create_namespace,
post_renderer=post_renderer,
replace=replace,
skip_crds=skip_crds,
history_max=history_max,
Expand Down