From 0cfd0f4bfae9e5d274bef0f41797a8dfd8e7ef7e Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Thu, 7 Aug 2025 08:55:44 +0200 Subject: [PATCH] Find image from bindata csvs based on container name instead of order Using the order in the list of containers is fragile as it can change based on implementation details as kustomization syntax of the service operators. This patch is moving to use the container name of the operator manager which should be consistent and deterministic. Signed-off-by: Alfredo Moralejo --- hack/sync-bindata.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hack/sync-bindata.sh b/hack/sync-bindata.sh index 7951e33a33..0542b87cf4 100755 --- a/hack/sync-bindata.sh +++ b/hack/sync-bindata.sh @@ -286,10 +286,12 @@ EOF_CAT for X in $(ls manifests/*clusterserviceversion.yaml); do OPERATOR_NAME=$(echo $X | sed -e "s|manifests\/\([^\.]*\)\..*|\1|" | sed -e "s|-|_|g" | tr '[:lower:]' '[:upper:]' ) echo $OPERATOR_NAME - if [[ $OPERATOR_NAME == "RABBITMQ_CLUSTER_OPERATOR" ]] || [[ $OPERATOR_NAME == "WATCHER_OPERATOR" ]]; then - IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r .spec.install.spec.deployments[0].spec.template.spec.containers[0].image) + if [[ $OPERATOR_NAME == "RABBITMQ_CLUSTER_OPERATOR" ]]; then + # Rabbitmq cluster operator has just a container in the deployment and name is operator, different that openstack ones + IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r '.spec.install.spec.deployments[0].spec.template.spec.containers.[] | select(.name == "operator") | .image') else - IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r .spec.install.spec.deployments[0].spec.template.spec.containers[1].image) + # The name of the actual operator container in the openstack operators is manager + IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r '.spec.install.spec.deployments[0].spec.template.spec.containers.[] | select(.name == "manager") | .image') fi echo $IMAGE