diff --git a/scripts/shared/deploy.sh b/scripts/shared/deploy.sh index c37f84e4a..600f75ed5 100755 --- a/scripts/shared/deploy.sh +++ b/scripts/shared/deploy.sh @@ -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 + exit 1 +fi + # Print installed versions for manual validation of CI subctl show versions print_clusters_message diff --git a/scripts/shared/lib/deploy_operator b/scripts/shared/lib/deploy_operator index a56e6873f..e9852e2b3 100644 --- a/scripts/shared/lib/deploy_operator +++ b/scripts/shared/lib/deploy_operator @@ -18,6 +18,7 @@ component_by_image['submariner-operator']=submariner-operator component_by_image['submariner-route-agent']=submariner-routeagent component_by_image['lighthouse-agent']=submariner-lighthouse-agent component_by_image['lighthouse-coredns']=submariner-lighthouse-coredns +component_by_image['nettest']='submariner-nettest submariner-metrics-proxy' ### Functions ### @@ -66,9 +67,11 @@ function subctl_install_subm() { [[ "$AIR_GAPPED" = true ]] && extra_flags+=(--repository "${SUBM_IMAGE_REPO}" --version "${SUBM_IMAGE_TAG}") for image in ${PRELOAD_IMAGES}; do - local image_key="${component_by_image[$image]}" - [[ -n "${image_key}" ]] || continue - extra_flags+=(--image-override "${image_key}=${SUBM_IMAGE_REPO}/${image}:${SUBM_IMAGE_TAG}") + local image_keys="${component_by_image[$image]}" + [[ -n "${image_keys}" ]] || continue + for image_key in $image_keys; do + extra_flags+=(--image-override "${image_key}=${SUBM_IMAGE_REPO}/${image}:${SUBM_IMAGE_TAG}") + done done fi