Skip to content

Commit 1483c08

Browse files
Merge pull request openstack-k8s-operators#1555 from amoralej/bindata-images
Find image from bindata csvs based on container name instead of order
2 parents b24083b + 0cfd0f4 commit 1483c08

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hack/sync-bindata.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,12 @@ EOF_CAT
286286
for X in $(ls manifests/*clusterserviceversion.yaml); do
287287
OPERATOR_NAME=$(echo $X | sed -e "s|manifests\/\([^\.]*\)\..*|\1|" | sed -e "s|-|_|g" | tr '[:lower:]' '[:upper:]' )
288288
echo $OPERATOR_NAME
289-
if [[ $OPERATOR_NAME == "RABBITMQ_CLUSTER_OPERATOR" ]] || [[ $OPERATOR_NAME == "WATCHER_OPERATOR" ]]; then
290-
IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r .spec.install.spec.deployments[0].spec.template.spec.containers[0].image)
289+
if [[ $OPERATOR_NAME == "RABBITMQ_CLUSTER_OPERATOR" ]]; then
290+
# Rabbitmq cluster operator has just a container in the deployment and name is operator, different that openstack ones
291+
IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r '.spec.install.spec.deployments[0].spec.template.spec.containers.[] | select(.name == "operator") | .image')
291292
else
292-
IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r .spec.install.spec.deployments[0].spec.template.spec.containers[1].image)
293+
# The name of the actual operator container in the openstack operators is manager
294+
IMAGE=$(cat $X | $LOCAL_BINARIES/yq -r '.spec.install.spec.deployments[0].spec.template.spec.containers.[] | select(.name == "manager") | .image')
293295
fi
294296
echo $IMAGE
295297

0 commit comments

Comments
 (0)