Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
fix: Replaces images with digests
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Jul 11, 2023
1 parent 45823bf commit 0005e23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/dockerfiles/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ if env | grep -q ".*devfile_registry_image.*"; then

readarray -t devfiles < <(find "${DEVFILES_DIR}" -name 'devworkspace-che-*.yaml')
for devfile in "${devfiles[@]}"; do
# Put an actual image on the same line with 'image' field
# It allows to grep image with digest in the next step
sed -i -z -E 's|image: >-\n[ ]+|image: |g' ${devfile}

readarray -t images < <(grep "image:" "${devfile}" | sed -r "s;.*image:[[:space:]]*'?\"?([._:a-zA-Z0-9-]*/?[._a-zA-Z0-9-]*/[._a-zA-Z0-9-]*(@sha256)?:?[._a-zA-Z0-9-]*)'?\"?[[:space:]]*;\1;")
for image in "${images[@]}"; do
separators="${image//[^\/]}"
Expand Down

0 comments on commit 0005e23

Please sign in to comment.