mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-30 03:14:40 +00:00
Ensure check mode results are as expected
check_mode with wait updates the result based on the existing resource which won't change with check_mode, so returns incorrect results. Only run the wait checks in non check_mode (this also avoids the issue of waiting for resource creation that will never happen in check mode)
This commit is contained in:
@@ -83,11 +83,13 @@
|
||||
k8s_pod_name: wait-ds
|
||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:2
|
||||
register: update_ds_check_mode
|
||||
check_mode: yes
|
||||
|
||||
- name: Check that check_mode returned changed
|
||||
- name: Check that check_mode result contains the changes
|
||||
assert:
|
||||
that:
|
||||
- update_ds_check_mode is changed
|
||||
- "update_ds_check_mode.result.spec.template.spec.containers[0].image == 'gcr.io/kuar-demo/kuard-amd64:2'"
|
||||
|
||||
- name: Update a daemonset
|
||||
k8s:
|
||||
|
||||
Reference in New Issue
Block a user