From a25ff47721e600d7f627d924bdc2953abaf9d1a4 Mon Sep 17 00:00:00 2001 From: Arnau Verdaguer Date: Thu, 25 Jun 2026 16:16:47 +0200 Subject: [PATCH] Strenghten ready condition on set openstack containers 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 --- roles/set_openstack_containers/tasks/main.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/roles/set_openstack_containers/tasks/main.yml b/roles/set_openstack_containers/tasks/main.yml index 92d79eb85..ee19675c1 100644 --- a/roles/set_openstack_containers/tasks/main.yml +++ b/roles/set_openstack_containers/tasks/main.yml @@ -119,6 +119,31 @@ - operator_name != 'openstack' - not cifmw_architecture_scenario is defined +# Wait for 4 minutes so openstack-operator can be restarted in consecuence +# of reinstalating the meta operator +# It will get the current value of rabbitmq image and wait until it's updated +# with the value set by the update_env_vars.sh script +- name: Wait for openstack-operator to contain the new image values + environment: + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" + PATH: "{{ cifmw_path }}" + ansible.builtin.shell: + cmd: | + set -o pipefail + oc get \ + --namespace={{ operator_namespace }} \ + $(oc get pod -l app.kubernetes.io/name=openstack-operator --no-headers=true -o name) \ + -o json | \ + jq -r '.spec.containers[].env[] | select(.name == "RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT") | .value' | \ + grep -q {{ cifmw_set_openstack_containers_tag }} \ + register: rabbitmq_image + until: rabbitmq_image.rc == 0 + retries: 24 + delay: 10 + when: + - operator_name == 'openstack' + - not cifmw_architecture_scenario is defined + - name: Retrieve operator pods environment: KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"