Created
September 23, 2024 04:18
-
-
Save chulkilee/a13f971dafd7fa5387f97f0b4162d691 to your computer and use it in GitHub Desktop.
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
#!/bin/bash -u | |
k8s_context=$1 | |
# https://kubernetes.io/docs/tasks/access-application-cluster/list-all-running-container-images/ | |
images=$(kubectl --context $1 get pods --all-namespaces -o jsonpath="{.items[*].spec['initContainers', 'containers'][*].image}" \ | |
| tr -s '[[:space:]]' '\n' \ | |
| sort \ | |
| uniq) | |
for image in $images; do | |
crane manifest "$image" > /dev/null 2>&1 && echo "$image: OK" || echo "$image: ERROR" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment