summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/k8s/raw.py
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2019-09-20 09:02:41 -0700
committerGitHub <noreply@github.com>2019-09-20 09:02:41 -0700
commit895d3c1c1e2f9fa837fa241550b3a68c982a48c6 (patch)
tree8f943e92a98a3a322a101d361de844feba8efb79 /lib/ansible/module_utils/k8s/raw.py
parentde3e76ad9834b3b99e7b92239310c525f06a0cfe (diff)
downloadansible-895d3c1c1e2f9fa837fa241550b3a68c982a48c6.tar.gz
[stable-2.9] k8s: apply no longer the default behaviour (#62632) (#62666)
* [stable-2.9] k8s: apply no longer the default behaviour (#62632) There are too many lingering uncertainties about the correctness of apply behaviour. All tests seem to suggest it works, and it's definitely performed well in real world application, but it may be a breaking and unexpected change to default to apply We will let apply bed in during 2.9 and allow people to opt in, we may default to it in future (or not) (cherry picked from commit bb0fa0a) Co-authored-by: Will Thames <will@thames.id.au>
Diffstat (limited to 'lib/ansible/module_utils/k8s/raw.py')
-rw-r--r--lib/ansible/module_utils/k8s/raw.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ansible/module_utils/k8s/raw.py b/lib/ansible/module_utils/k8s/raw.py
index c820992808..4c4fa370eb 100644
--- a/lib/ansible/module_utils/k8s/raw.py
+++ b/lib/ansible/module_utils/k8s/raw.py
@@ -90,7 +90,7 @@ class KubernetesRawModule(KubernetesAnsibleModule):
argument_spec['wait_condition'] = dict(type='dict', default=None, options=self.condition_spec)
argument_spec['validate'] = dict(type='dict', default=None, options=self.validate_spec)
argument_spec['append_hash'] = dict(type='bool', default=False)
- argument_spec['apply'] = dict(type='bool')
+ argument_spec['apply'] = dict(type='bool', default=False)
return argument_spec
def __init__(self, k8s_kind=None, *args, **kwargs):
@@ -123,12 +123,10 @@ class KubernetesRawModule(KubernetesAnsibleModule):
if self.params['merge_type']:
if LooseVersion(self.openshift_version) < LooseVersion("0.6.2"):
self.fail_json(msg=missing_required_lib("openshift >= 0.6.2", reason="for merge_type"))
- if self.params.get('apply') is not None:
+ self.apply = self.params.get('apply', False)
+ if self.apply:
if not HAS_K8S_APPLY:
self.fail_json(msg=missing_required_lib("openshift >= 0.9.2", reason="for apply"))
- self.apply = self.params['apply']
- else:
- self.apply = HAS_K8S_APPLY
if resource_definition:
if isinstance(resource_definition, string_types):