mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 13:02:37 +00:00
k8s_exec: Return rc for the command executed (#158)
k8s_exec now returns command return code in output. Fixes: #122 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
@@ -43,6 +43,19 @@
|
||||
that:
|
||||
- "'nameserver' in output.stdout"
|
||||
|
||||
- name: Check if rc is returned for the given command
|
||||
k8s_exec:
|
||||
namespace: "{{ exec_namespace }}"
|
||||
pod: "{{ pod }}"
|
||||
command: 'false'
|
||||
register: command_status
|
||||
ignore_errors: True
|
||||
|
||||
- name: Check last command status
|
||||
assert:
|
||||
that:
|
||||
- command_status.return_code != 0
|
||||
|
||||
always:
|
||||
- name: "Cleanup namespace"
|
||||
k8s:
|
||||
|
||||
Reference in New Issue
Block a user