Skip to content

Commit

Permalink
Update jq query to replace SHA of the olm.bundle without effecting ot…
Browse files Browse the repository at this point in the history
…her sha of a olm.bundle

Signed-off-by: savitaashture <[email protected]>
  • Loading branch information
savitaashture committed Mar 6, 2025
1 parent f4ad5d2 commit afca17e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/index-render-template-1-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ jobs:
echo "Bundle Image updated for index images : $BUNDLE_IMAGE"

##Update the image field with $BUNDLE_IMAGE
jq "(.entries[] | select(.schema == \"olm.bundle\")).image = \"$BUNDLE_IMAGE\"" $CATALOG_JSON > temp.json && mv temp.json $CATALOG_JSON
## There are multiple olm.bundle entries for all previously released versions.
## The releasing version is placed first to ensure proper replacement.
jq --arg BUNDLE_IMAGE "$BUNDLE_IMAGE" '( .entries | to_entries | map(select(.value.schema == "olm.bundle")) | .[0].key ) as $firstIndex | if $firstIndex then .entries[$firstIndex].image = $BUNDLE_IMAGE else . end' "$CATALOG_JSON" > temp.json && mv temp.json "$CATALOG_JSON"
echo "Update bundle Image in $CATALOG_JSON"

BUNDLE_VERSION=$(opm render --skip-tls-verify -o json ${BUNDLE_IMAGE} | jq -r '.name' | awk -F 'v' '{ print $2 }')
Expand Down

0 comments on commit afca17e

Please sign in to comment.