Fixes #13: Fix missing 'elements' in list argument spec.

This commit is contained in:
Jeff Geerling
2020-02-07 14:25:11 -06:00
parent e0a6976c3b
commit 18fb76c695
4 changed files with 10 additions and 5 deletions

View File

@@ -84,7 +84,7 @@ class KubernetesRawModule(KubernetesAnsibleModule):
def argspec(self):
argument_spec = copy.deepcopy(COMMON_ARG_SPEC)
argument_spec.update(copy.deepcopy(AUTH_ARG_SPEC))
argument_spec['merge_type'] = dict(type='list', choices=['json', 'merge', 'strategic-merge'])
argument_spec['merge_type'] = dict(type='list', elements='str', choices=['json', 'merge', 'strategic-merge'])
argument_spec['wait'] = dict(type='bool', default=False)
argument_spec['wait_sleep'] = dict(type='int', default=5)
argument_spec['wait_timeout'] = dict(type='int', default=120)

View File

@@ -66,6 +66,7 @@ options:
- merge
- strategic-merge
type: list
elements: str
version_added: "2.7"
wait:
description:

View File

@@ -59,9 +59,11 @@ options:
label_selectors:
description: List of label selectors to use to filter results
type: list
elements: str
field_selectors:
description: List of field selectors to use to filter results
type: list
elements: str
extends_documentation_fragment:
- community.kubernetes.k8s_auth_options
@@ -170,8 +172,8 @@ class KubernetesInfoModule(KubernetesAnsibleModule):
api_version=dict(default='v1', aliases=['api', 'version']),
name=dict(),
namespace=dict(),
label_selectors=dict(type='list', default=[]),
field_selectors=dict(type='list', default=[]),
label_selectors=dict(type='list', elements='str', default=[]),
field_selectors=dict(type='list', elements='str', default=[]),
)
)
return args

View File

@@ -73,6 +73,7 @@ options:
- merge
- strategic-merge
type: list
elements: str
name:
description:
- Use to specify a Service object name.
@@ -98,6 +99,7 @@ options:
- A list of ports to expose.
- U(https://kubernetes.io/docs/concepts/services-networking/service/#multi-port-services)
type: list
elements: dict
selector:
description:
- Label selectors identify objects this Service should apply to.
@@ -188,7 +190,7 @@ SERVICE_ARG_SPEC = {
},
'name': {'required': True},
'namespace': {'required': True},
'merge_type': {'type': 'list', 'choices': ['json', 'merge', 'strategic-merge']},
'merge_type': {'type': 'list', 'elements': 'str', 'choices': ['json', 'merge', 'strategic-merge']},
'selector': {'type': 'dict'},
'type': {
'type': 'str',
@@ -196,7 +198,7 @@ SERVICE_ARG_SPEC = {
'NodePort', 'ClusterIP', 'LoadBalancer', 'ExternalName'
],
},
'ports': {'type': 'list'},
'ports': {'type': 'list', 'elements': 'dict'},
}