Merge pull request #84 from willthames/k8s_apply_check_mode_fix

K8s apply check mode fix
This commit is contained in:
Fabian von Feilitzsch
2020-05-15 12:58:40 -04:00
committed by GitHub
3 changed files with 35 additions and 5 deletions

View File

@@ -299,7 +299,11 @@ class KubernetesRawModule(KubernetesAnsibleModule):
else:
if self.apply:
if self.check_mode:
ignored, k8s_obj = apply_object(resource, definition)
ignored, patch = apply_object(resource, definition)
if existing:
k8s_obj = dict_merge(existing.to_dict(), patch)
else:
k8s_obj = patch
else:
try:
k8s_obj = resource.apply(definition, namespace=namespace).to_dict()