-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check deployed images against newly-built images #1265
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,25 @@ fi | |
|
||
run_if_defined post_deploy | ||
|
||
# Check that the deployed images match those we built (if any) | ||
image_mismatch=false | ||
for image in package/.image.*; do | ||
expected="$(docker image inspect "$(cat "$image")" | jq -r '.[0].RepoDigests[0]')" | ||
image="${image#package/.image.}" | ||
for deployed in $(kubectl get pods -A -o json | jq -r '.items[].status.containerStatuses[].imageID' | grep "$image"); do | ||
if [ "$deployed" != "$expected" ]; then | ||
printf "Image %s is deployed with %s, expected %s\n" "$image" "$deployed" "$expected" | ||
image_mismatch=true | ||
else | ||
printf "Successfully checked image %s, deployed with %s\n" "$image" "$deployed" | ||
fi | ||
done | ||
done | ||
if [ "$image_mismatch" = true ]; then | ||
kubectl get pods -A -o json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is too verbose and will be simplified before the patch is submitted for final review. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this still need tweaking? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I see it in the logs now, very verbose https://github.com/submariner-io/shipyard/actions/runs/5389288771/jobs/9783083207?pr=1265#step:6:3131 |
||
exit 1 | ||
fi | ||
|
||
# Print installed versions for manual validation of CI | ||
subctl show versions | ||
print_clusters_message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be run when opted-in, since you might want to deploy with various images when deploying locally or when we're doing upgrade testing