mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-08 05:52:37 +00:00
Helm template add name and disable hook (#405)
Helm template add name and disable hook SUMMARY This PR adds "disable_hook" and "name" (NAME of the release) as optional arguments to the helm_template module. It contains the rest of my planned work towards #313. ISSUE TYPE Feature Pull Request COMPONENT NAME plugins/modules/helm_template.py changelogs/fragments/313-helm-template-add-support-for-name-and-disablehook.yml tests/unit/modules/test_helm_template.py integration/targets/helm/tasks/tests_chart.yml ADDITIONAL INFORMATION The PR contains unit tests and an integration test for the new parameters added in this and the previous PR. I limited the execution of the integration test to the local test chart, because the testing of the "show_only" parameter requires a known chart structure. As I think I do not have to test the workings of "helm template ..." itself, I hope this is sufficient. Please adjust / comment as necessary. Reviewed-by: Mike Graves <mgraves@redhat.com>
This commit is contained in:
committed by
GitHub
parent
b5cfc854cb
commit
95e2add65b
@@ -361,6 +361,31 @@
|
||||
that:
|
||||
result.stat.exists
|
||||
|
||||
- name: Render single template from chart to result
|
||||
helm_template:
|
||||
binary_path: "{{ helm_binary }}"
|
||||
chart_ref: "{{ chart_source }}"
|
||||
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||
disable_hook: True
|
||||
release_name: "MyRelease"
|
||||
release_namespace: "MyReleaseNamespace"
|
||||
show_only:
|
||||
- "templates/configmap.yaml"
|
||||
release_values:
|
||||
"myValue": "ThisValue"
|
||||
register: result
|
||||
when: chart_source is search("test-chart")
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is not failed
|
||||
- result.rc == 0
|
||||
- result.command is match("{{ helm_binary }} template MyRelease {{ chart_source }}")
|
||||
- result.stdout is search("ThisValue")
|
||||
when: chart_source is search("test-chart")
|
||||
# limit assertion of test result to controlled (local) chart_source
|
||||
|
||||
- name: Release using non-existent context
|
||||
helm:
|
||||
binary_path: "{{ helm_binary }}"
|
||||
|
||||
Reference in New Issue
Block a user