diff --git a/hack/diff-image.sh b/hack/diff-image.sh index 6baf5a0..14e85ed 100755 --- a/hack/diff-image.sh +++ b/hack/diff-image.sh @@ -166,7 +166,10 @@ function copy-image() { function list-tags() { local image="${1:-}" - local raw="$(${SKOPEO} list-tags --retry-times "${RETRY}" --no-creds --tls-verify=false "docker://${image}" | ${JQ} -r '.Tags[]' | sort)" + local raw="$(${SKOPEO} list-tags --retry-times "${RETRY}" --no-creds --tls-verify=false "docker://${image}" | ${JQ} -r '.Tags[]')" + + # Sort by string length + raw=$(echo "${raw}" | awk '{print length, $0}' | sort -n | awk '{print $2}') if [[ "${FOCUS}" != "" ]]; then local skip=$(echo "${raw}" | grep -v -E "${FOCUS}")