mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-29 02:44:41 +00:00
Fix scale wait and add tests
Move wait logic out of raw and into common and use that logic in scale Fix a few broken wait condition cases highlighted by scaling up and down Move scale-related tests into dedicated test task file Additional service related tests
This commit is contained in:
@@ -55,12 +55,6 @@
|
||||
wait: yes
|
||||
register: scale_down
|
||||
|
||||
# It looks like the Deployment is updated to have the desired state *before* the pods are terminated
|
||||
# Wait a couple of seconds to allow the pods to at least get to Terminating state
|
||||
- name: Avoid race condition
|
||||
pause:
|
||||
seconds: 2
|
||||
|
||||
- name: Get pods in scale-deploy
|
||||
k8s_info:
|
||||
kind: Pod
|
||||
@@ -70,6 +64,9 @@
|
||||
field_selectors:
|
||||
- status.phase=Running
|
||||
register: scale_down_deploy_pods
|
||||
until: "{{ scale_down_deploy_pods.resources | length == 0 }}"
|
||||
retries: 6
|
||||
delay: 5
|
||||
|
||||
- name: Ensure that scale down took effect
|
||||
assert:
|
||||
@@ -77,7 +74,6 @@
|
||||
- scale_down is changed
|
||||
- '"duration" in scale_down'
|
||||
- scale_down.diff
|
||||
- scale_down_deploy_pods.resources | length == 0
|
||||
|
||||
- name: Reapply the earlier deployment
|
||||
k8s:
|
||||
|
||||
Reference in New Issue
Block a user