mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
k8s support diff mode (#146)
* support diff mode for k8s module * Update and rename 145-k8s-add-support-diff-mode.yml to 146-k8s-add-support-diff-mode.yml * Update 146-k8s-add-support-diff-mode.yml * Update changelogs/fragments/146-k8s-add-support-diff-mode.yml Co-authored-by: Mike Graves <mgraves@redhat.com> * update k8s_scale and k8s_json_patch * diff for k8s_scale and k8s_json_patch Co-authored-by: Mike Graves <mgraves@redhat.com>
This commit is contained in:
@@ -693,7 +693,8 @@ class K8sAnsibleMixin(object):
|
||||
existing = {}
|
||||
match, diffs = self.diff_objects(existing, result['result'])
|
||||
result['changed'] = not match
|
||||
result['diff'] = diffs
|
||||
if self.module._diff:
|
||||
result['diff'] = diffs
|
||||
result['method'] = 'apply'
|
||||
if not success:
|
||||
msg = "Resource apply timed out"
|
||||
@@ -785,7 +786,8 @@ class K8sAnsibleMixin(object):
|
||||
match, diffs = self.diff_objects(existing.to_dict(), result['result'])
|
||||
result['changed'] = not match
|
||||
result['method'] = 'replace'
|
||||
result['diff'] = diffs
|
||||
if self.module._diff:
|
||||
result['diff'] = diffs
|
||||
if not success:
|
||||
msg = "Resource replacement timed out"
|
||||
if continue_on_error:
|
||||
@@ -819,7 +821,8 @@ class K8sAnsibleMixin(object):
|
||||
match, diffs = self.diff_objects(existing.to_dict(), result['result'])
|
||||
result['changed'] = not match
|
||||
result['method'] = 'patch'
|
||||
result['diff'] = diffs
|
||||
if self.module._diff:
|
||||
result['diff'] = diffs
|
||||
|
||||
if not success:
|
||||
msg = "Resource update timed out"
|
||||
|
||||
Reference in New Issue
Block a user