Checking the length of tags for verify-image (#121)
This commit is contained in:
parent
5715ee47a5
commit
96382a8a94
|
@ -10,7 +10,27 @@ git apply -R <(curl -fsSL "${patch_url}") || :
|
||||||
|
|
||||||
list=$(diff --unified "${file}" "${file}.bak" | grep '^+\w' | sed 's/^+//' || :)
|
list=$(diff --unified "${file}" "${file}.bak" | grep '^+\w' | sed 's/^+//' || :)
|
||||||
|
|
||||||
|
failed=()
|
||||||
for image in ${list}; do
|
for image in ${list}; do
|
||||||
echo "Checking image: ${image}"
|
echo "Checking image: ${image}"
|
||||||
skopeo list-tags --retry-times 3 "docker://${image}" || { echo "Not Found ${image}" ; exit 1; }
|
raw=$(skopeo list-tags --no-creds --tls-verify=false --retry-times 3 "docker://${image}")
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
failed+=("not found ${image}")
|
||||||
|
echo "Not found ${image}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [[ $(echo "${raw}" | jq '.Tags | length') -eq 0 ]]; then
|
||||||
|
failed+=("found ${image} but no tags")
|
||||||
|
echo "Found ${image} but no tags"
|
||||||
|
echo "${raw}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ ${#failed[@]} -ne 0 ]]; then
|
||||||
|
echo "Failed images:"
|
||||||
|
for image in "${failed[@]}"; do
|
||||||
|
echo " ${image}"
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue