mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 21:12:37 +00:00
Support template param in other collections (#154)
* Support template param in other collections The action plugin for k8s does a collection name check for the template param, but it's missing redhat.openshift and community.kubernetes. * Add changelog fragment * Fix test
This commit is contained in:
3
changelogs/fragments/154-template-param-support.yaml
Normal file
3
changelogs/fragments/154-template-param-support.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
bugfixes:
|
||||
- support the ``template`` param in all collections depending on kubernetes.core (https://github.com/ansible-collections/kubernetes.core/pull/154).
|
||||
@@ -22,7 +22,7 @@
|
||||
assert:
|
||||
that:
|
||||
- r.failed
|
||||
- "'is only supported parameter for' in r.msg"
|
||||
- "'is only a supported parameter for' in r.msg"
|
||||
|
||||
- name: Specify both definition and template
|
||||
kubernetes.core.k8s:
|
||||
|
||||
@@ -126,8 +126,8 @@ class ActionModule(ActionBase):
|
||||
|
||||
def load_template(self, template, new_module_args, task_vars):
|
||||
# template is only supported by k8s module.
|
||||
if self._task.action not in ('k8s', 'kubernetes.core.k8s', 'community.okd.k8s'):
|
||||
raise AnsibleActionFail("'template' is only supported parameter for 'k8s' module.")
|
||||
if self._task.action not in ('k8s', 'kubernetes.core.k8s', 'community.okd.k8s', 'redhat.openshift.k8s', 'community.kubernetes.k8s'):
|
||||
raise AnsibleActionFail("'template' is only a supported parameter for the 'k8s' module.")
|
||||
|
||||
template_params = []
|
||||
if isinstance(template, string_types) or isinstance(template, dict):
|
||||
|
||||
Reference in New Issue
Block a user