devspaces icon indicating copy to clipboard operation
devspaces copied to clipboard

add support for unsortable tags (SHA tags) and non-standard :latest tag

Open nickboldt opened this issue 3 years ago • 0 comments

What does this PR do?

#21575 add support for unsorted tags (when dealing with non-semver image tags like https://quay.io/repository/devfile/base-developer-image?tab=tags&tag=latest which is SHA-based tags); add support for non-standard latet tag queries (eg., if there's no :latest tag, use :ubi8-latest)

Change-Id: I6b36210499b7625e19f2cf389f608d8cb452ff14 Signed-off-by: Nick Boldt [email protected]

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

https://github.com/eclipse/che/issues/21575

How to test this PR?

  1. check out this PR:

https://github.com/devfile/developer-images/pull/46/commits/ec3d8c079542e8d90661ba6e92fb228baf523e27

  1. change the ubi8/Dockerfile so it's building from:
# https://quay.io/devfile/base-developer-image#^ubi8-
FROM quay.io/devfile/base-developer-image:ubi8-8d9dc15
  1. get scripts:
cd /tmp; curl -sSLkO https://raw.githubusercontent.com/redhat-developer/devspaces/2f8fbbea472be0f2953cb8ce33d72dc3ccfc20dd/product/getLatestImageTags.sh
cd /tmp; curl -sSLkO https://raw.githubusercontent.com/redhat-developer/devspaces/2f8fbbea472be0f2953cb8ce33d72dc3ccfc20dd/product/updateBaseImages.sh
chmod +x *.sh
  1. run an update of the Dockerfiles:
cd /where/you/have developer-images checked out/
/tmp/updateBaseImages.sh -b main -w `pwd` -f Dockerfile      -maxdepth 3 --no-commit --no-push  -x "latest|main|source" --latestNext ubi8-latest --sort-tags false -v

This is the error I don't let know how to work around -- the newer tag is found, but the "which one is greater?" check is failing:

#CURR_TAGver=ubi8; CURR_TAGrev=8d9dc15; CURR_TAGrevbase=8d9dc15; CURR_TAGrevsuf=8d9dc15
#LATE_TAGver=ubi8; LATE_TAGrev=13008af; LATE_TAGrevbase=13008af; LATE_TAGrevsuf=13008af
- quay.io/devfile/base-developer-image:ubi8-8d9dc15
/home/nboldt/p/updateBaseImages.sh: line 306: [[: 13008af: value too great for base (error token is "13008af")
/home/nboldt/p/updateBaseImages.sh: line 306: [[: 13008af: value too great for base (error token is "13008af")

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

nickboldt avatar Dec 06 '22 16:12 nickboldt