Skip to content

Commit

Permalink
Adds new curl url for docker.io in pin-bundle script
Browse files Browse the repository at this point in the history
Since we are facing issues with quay.rdoproject to push image from
Prow CI, we plan to move jobs images to docker.io. To properly build the
bundles we need to fix pin-bundle-images script to retrieve the
proper tag.
  • Loading branch information
viroel committed Jan 23, 2024
1 parent 0019b4c commit 252b221
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hack/pin-bundle-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ for MOD_PATH in $(go list -mod=readonly -m -json all | jq -r '. | select(.Path |
# for local registry
if [[ ${LOCAL_REGISTRY} -eq 1 ]]; then
REPO_CURL_URL="${CURL_REGISTRY}/v2/${IMAGENAMESPACE}"
elif [[ "${CURL_REGISTRY}" == "docker.io" ]]; then
# replace docker.io by hub.docker.com to read tags
REPO_CURL_URL="https://hub.docker.com/v2/repositories/${IMAGENAMESPACE}"
else
REPO_CURL_URL="https://${CURL_REGISTRY}/api/v1/repository/${IMAGENAMESPACE}"
fi
Expand All @@ -61,6 +64,8 @@ for MOD_PATH in $(go list -mod=readonly -m -json all | jq -r '. | select(.Path |

if [[ ${LOCAL_REGISTRY} -eq 1 && ( "$GITHUB_USER" != "openstack-k8s-operators" || "$BASE" == "$IMAGEBASE" ) ]]; then
SHA=$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tags/list | jq -r .tags[] | sort -u | grep $REF)
elif [[ "${CURL_REGISTRY}" == "docker.io" ]]; then
SHA=$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tags/?page_size=100 | sort -u | grep $REF)
elif [[ "${CURL_REGISTRY}" != "quay.io" ]]; then
# quay.rdoproject.io doesn't support filter_tag_name, so increase limit to 100
SHA=$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tag/?onlyActiveTags=true?limit=100 | jq -r .tags[].name | sort -u | grep $REF)
Expand Down

0 comments on commit 252b221

Please sign in to comment.