File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,17 @@ function create_cluster() {
153153 cp $ASSET $ASSET_NEW
154154 for IMAGE in $( yq ' .. | objects | select(has("containers")) | .containers[].image' $ASSET -r | sort | uniq) ; do
155155 IMAGE_SHORT=${IMAGE##*/ }
156+ [[ $IMAGE_SHORT =~ " @" ]] && DIGEST=${IMAGE_SHORT##*@ }
157+ # Remove digest from the short name for podman push
158+ IMAGE_SHORT=${IMAGE_SHORT%@* }
156159 IMAGE_MIRRORED=${LOCAL_REGISTRY_DNS_NAME} :${LOCAL_REGISTRY_PORT} /localimages/assets/${IMAGE_SHORT}
157160 sudo -E podman pull --authfile $PULL_SECRET_FILE $IMAGE
158161 sudo podman push --tls-verify=false --remove-signatures --authfile $PULL_SECRET_FILE $IMAGE $IMAGE_MIRRORED
162+ if [[ -n ${DIGEST:- } ]]; then
163+ # Get digest of the pushed image
164+ DIGEST=$( podman inspect --format " {{.Digest}}" $IMAGE_MIRRORED )
165+ IMAGE_MIRRORED=" ${IMAGE_MIRRORED} @${DIGEST} "
166+ fi
159167 sed -i -e " s%${IMAGE} %${IMAGE_MIRRORED} %g" $ASSET_NEW
160168 done
161169 done
You can’t perform that action at this time.
0 commit comments