-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace image validity check with shell script
The script is more or less straight forward and saves us some go dependencies and a custom go build execution. Signed-off-by: Tom Wieczorek <[email protected]>
- Loading branch information
Showing
6 changed files
with
61 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env sh | ||
#shellcheck disable=SC3043 | ||
|
||
set -eu | ||
|
||
check_platforms() { | ||
# shellcheck disable=SC2016 | ||
local filter=' | ||
$ARGS.positional - [.manifests[].platform | "\(.os)/\(.architecture)"] | ||
| if length == 0 then "ok" else "missing platforms: " + join(", ") end | ||
' | ||
docker manifest inspect -- "$image" | jq --args -r "$filter" -- "$@" | ||
} | ||
|
||
ret=0 | ||
while read -r image; do | ||
case "$image" in | ||
*/envoy-distroless:*) set -- linux/amd64 linux/arm64 ;; | ||
*) set -- linux/amd64 linux/arm64 linux/arm ;; | ||
esac | ||
|
||
printf 'Checking image validity for %s ... ' "$image" >&2 | ||
check=$(check_platforms "$@") | ||
if [ "$check" != "ok" ]; then | ||
ret=1 | ||
printf '\033[31m%s\033[0m\n' "$check" >&2 | ||
else | ||
printf '\033[32mok: %s\033[0m\n' "$*" >&2 | ||
fi | ||
done | ||
|
||
exit $ret |
This file was deleted.
Oops, something went wrong.