Skip to content

Instantly share code, notes, and snippets.

@reespozzi
Created February 17, 2026 15:15
Show Gist options
  • Select an option

  • Save reespozzi/f3ca089e12bfdb991379b6e0b463f45d to your computer and use it in GitHub Desktop.

Select an option

Save reespozzi/f3ca089e12bfdb991379b6e0b463f45d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# make sure you az acr login to hmctsprod first, or hmctsbox if needed
ACR_NAME="hmctsprod" # ACR name, not FQDN
kubectl get pods --all-namespaces \
-o jsonpath='{range .items[*]}{range .spec.initContainers[*]}{.image}{"\n"}{end}{range .spec.containers[*]}{.image}{"\n"}{end}{end}' \
| sort -u \
| grep -E '(sdshmctspublic|hmctspublic|hmctsprivate|hmctssandbox)' \
| sed -e 's/sdshmctspublic/hmctsprod/g' -e 's/hmctspublic/hmctsprod/g' -e 's/hmctsprivate/hmctsprod/g' -e 's/hmctssandbox/hmctsprod/g'\
| while read -r image; do
image_no_registry="${image#*/}"
repo="${image_no_registry%%:*}"
tag="${image_no_registry##*:}"
if az acr repository show-tags \
--name "$ACR_NAME" \
--repository "$repo" \
--query "[?@=='$tag']" \
-o tsv | grep -q "$tag"; then
echo "FOUND $image"
else
echo "MISSING $image"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment