From 7364e79c0db232e1317ae57051ab6068885f8f30 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Fri, 31 May 2019 18:42:48 -0700 Subject: [PATCH] k8s: Fix .to_dict not needed (#56147) * k8s: Fix .to_dict not needed * Add changelog fragment --- changelogs/fragments/56147-k8s-update-with-force.yaml | 2 ++ lib/ansible/module_utils/k8s/raw.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/56147-k8s-update-with-force.yaml diff --git a/changelogs/fragments/56147-k8s-update-with-force.yaml b/changelogs/fragments/56147-k8s-update-with-force.yaml new file mode 100644 index 00000000000..5d980ed43e8 --- /dev/null +++ b/changelogs/fragments/56147-k8s-update-with-force.yaml @@ -0,0 +1,2 @@ +bugfixes: + - k8s - resource updates applied with force work correctly now diff --git a/lib/ansible/module_utils/k8s/raw.py b/lib/ansible/module_utils/k8s/raw.py index 35388b9a858..c986a3d22f7 100644 --- a/lib/ansible/module_utils/k8s/raw.py +++ b/lib/ansible/module_utils/k8s/raw.py @@ -318,7 +318,7 @@ class KubernetesRawModule(KubernetesAnsibleModule): result['result'] = k8s_obj if wait: success, result['result'], result['duration'] = self.wait(resource, definition, wait_timeout, condition=wait_condition) - match, diffs = self.diff_objects(existing.to_dict(), result['result'].to_dict()) + match, diffs = self.diff_objects(existing.to_dict(), result['result']) result['changed'] = not match result['method'] = 'replace' result['diff'] = diffs