Skip to content

Commit 3c09abf

Browse files
averdaguopenshift-merge-bot[bot]
authored andcommitted
[set_openstack_containers] improve ready condition
set_openstack_containers wait for the openstack-operator-init pod to be reinstalled, problem is that openstack-operator takes a minute to be restarted, which in some scenarios can cause problems, improving the wait logic to avoid that. Resolves: OSPRH-31605 Signed-off-by: Arnau Verdaguer <averdagu@redhat.com>
1 parent e5cd0c5 commit 3c09abf

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

  • roles/set_openstack_containers/tasks

roles/set_openstack_containers/tasks/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,33 @@
119119
- operator_name != 'openstack'
120120
- not cifmw_architecture_scenario is defined
121121

122+
# Wait for 4 minutes so openstack-operator can be restarted in consecuence
123+
# of reinstalating the meta operator
124+
# It will get the current value of rabbitmq image and wait until it's updated
125+
# with the value set by the update_env_vars.sh script
126+
- name: Wait for openstack-operator to contain the new image values
127+
environment:
128+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
129+
PATH: "{{ cifmw_path }}"
130+
ansible.builtin.shell:
131+
cmd: |
132+
set -o pipefail
133+
134+
# 1. Fetch the exact name of the target openstack-operator pod
135+
POD_NAME=$(oc get pod --namespace={{ operator_namespace }} -l app.kubernetes.io/name=openstack-operator --no-headers -o name)
136+
137+
# 2. Extract the RabbitMQ image variable and check for the target container tag
138+
oc get --namespace={{ operator_namespace }} "$POD_NAME" -o json | \
139+
jq -r '.spec.containers[].env[] | select(.name == "RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT") | .value' | \
140+
grep -q "{{ cifmw_set_openstack_containers_tag }}"
141+
register: rabbitmq_image
142+
until: rabbitmq_image.rc == 0
143+
retries: 24
144+
delay: 10
145+
when:
146+
- operator_name == 'openstack'
147+
- not cifmw_architecture_scenario is defined
148+
122149
- name: Retrieve operator pods
123150
environment:
124151
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"

0 commit comments

Comments
 (0)