Skip to content

Commit

Permalink
Rename result to patched_output
Browse files Browse the repository at this point in the history
  • Loading branch information
gravesm committed May 19, 2021
1 parent 2cc087c commit 29c0c27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions molecule/default/tasks/json_patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
assert:
that:
- result.changed
- result.result.metadata.labels.label2 == "bar"
- result.result.spec.containers[0].image == "busybox:glibc"
- result.patched_output.metadata.labels.label2 == "bar"
- result.patched_output.spec.containers[0].image == "busybox:glibc"

- name: Describe pod
kubernetes.core.k8s_info:
Expand Down Expand Up @@ -159,7 +159,7 @@
- name: Assert all replicas are available
assert:
that:
- result.result.status.availableReplicas == 3
- result.patched_output.status.availableReplicas == 3

always:
- name: Ensure namespace has been deleted
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/k8s_json_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
version_added: 2.0.0
author:
author:
- Mike Graves (@gravesm)
options:
Expand Down Expand Up @@ -84,7 +84,7 @@
'''

RETURN = r'''
result:
patched_output:
description: The modified object.
returned: success
type: dict
Expand Down Expand Up @@ -249,9 +249,9 @@ def build_error_msg(kind, name, msg):
module.fail_json(msg=msg, error=to_native(exc), status='', reason='')

success = True
result = {"result": obj}
result = {"patched_output": obj}
if wait and not module.check_mode:
success, result['result'], result['duration'] = k8s_module.wait(resource, definition, wait_sleep, wait_timeout, condition=wait_condition)
success, result['patched_output'], result['duration'] = k8s_module.wait(resource, definition, wait_sleep, wait_timeout, condition=wait_condition)
match, diffs = k8s_module.diff_objects(existing.to_dict(), obj)
result["changed"] = not match
result["diff"] = diffs
Expand Down

0 comments on commit 29c0c27

Please sign in to comment.