Skip to content

Commit

Permalink
simplify the wait logic for glance and telemetry pods
Browse files Browse the repository at this point in the history
  • Loading branch information
katarimanojk committed Oct 24, 2024
1 parent 3fec585 commit 2700ff3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
14 changes: 1 addition & 13 deletions tests/roles/glance_adoption/tasks/check_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
STATUS=$(oc get pod --selector=service=glance -o jsonpath='{.items[*].status.phase}{"\n"}');
code=1
IFS=" " read -r -a STATUS <<< "$STATUS"
for i in "${STATUS[@]}"; do
if echo "$i" | grep -v Running; then
# if at least one instance is not Running, return
exit $code
else
code=0
fi
done
exit $code
oc wait pod --for condition=Ready --selector=service=glance
register: glance_running_result
until: glance_running_result is success
retries: 60
Expand Down
6 changes: 3 additions & 3 deletions tests/roles/telemetry_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc get pod --selector=alertmanager=metric-storage -o jsonpath='{.items[0].status.phase}{"\n"}' | grep Running
oc wait pod --for condition=Ready --selector=alertmanager=metric-storage
register: alertmanager_running_result
until: alertmanager_running_result is success
retries: 60
Expand All @@ -46,7 +46,7 @@
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc get pod --selector=prometheus=metric-storage -o jsonpath='{.items[0].status.phase}{"\n"}' | grep Running
oc wait pod --for condition=Ready --selector=prometheus=metric-storage
register: prometheus_running_result
until: prometheus_running_result is success
retries: 60
Expand All @@ -62,7 +62,7 @@
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc get pod --selector=service=ceilometer -o jsonpath='{.items[0].status.phase}{"\n"}' | grep Running
oc wait pod --for condition=Ready --selector=service=ceilometer
register: ceilometer_running_result
until: ceilometer_running_result is success
retries: 60
Expand Down

0 comments on commit 2700ff3

Please sign in to comment.