mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-29 19:04:39 +00:00
This is a backport of PR #1033 as merged into main (3e32c12).
SUMMARY
Using exit_json or fail_json for warnings is deprecated in ansible-core>=2.19.0 and will be removed in ansible-core>=2.23.0
Tested with ansible-core 2.19.3 as the latest released version at the time of the start of this PR and with 2.16.0 as the lowest version supported by kubernetes.core 6.x
Resolves: #1031
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
k8s_drain
k8s_rollback
k8s_scale
ADDITIONAL INFORMATION
The initial version of this PR covers only the module k8s_drain, with the following commits extended to k8s_rollback
k8s_scale
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Mike Graves <mgraves@redhat.com>
This commit is contained in:
@@ -402,12 +402,16 @@
|
||||
namespace: "{{ namespace }}"
|
||||
register: result
|
||||
|
||||
- name: Debug result
|
||||
debug:
|
||||
var: result
|
||||
|
||||
- name: Assert warning is returned for no rollout history
|
||||
assert:
|
||||
that:
|
||||
- not result.changed
|
||||
- result.rollback_info[0].warnings is defined
|
||||
- "'No rollout history found' in result.rollback_info[0].warnings[0]"
|
||||
- result.warnings is defined
|
||||
- "'No rollout history found' in result.warnings[0]"
|
||||
|
||||
- name: Create a service for unsupported resource test
|
||||
k8s:
|
||||
|
||||
Reference in New Issue
Block a user