aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2026-01-05 10:15:31 +0100
committerPatrick Spek <p.spek@tyil.nl>2026-01-05 10:15:31 +0100
commitf1b6df77affa780c1db8d771edd62d209e2d3b61 (patch)
tree4f361d9b5e6920036149041ed30fe814599a8fa8
parentaf95bc283d2f71140e40a7bbe2c177dd78791bfc (diff)
downloaddotfiles-f1b6df77affa780c1db8d771edd62d209e2d3b61.tar.gz
dotfiles-f1b6df77affa780c1db8d771edd62d209e2d3b61.tar.bz2
Show docker.io for 'empty' registries
-rwxr-xr-x.local/bin/kubectl-registries13
1 files changed, 11 insertions, 2 deletions
diff --git a/.local/bin/kubectl-registries b/.local/bin/kubectl-registries
index c0a6d54..d6b04d2 100755
--- a/.local/bin/kubectl-registries
+++ b/.local/bin/kubectl-registries
@@ -5,9 +5,18 @@ main() {
--all-namespaces \
-o jsonpath="{.items[*].spec['initContainers', 'containers'][*].image}" \
| tr -s '[[:space:]]' '\n' \
+ | cut -d "/" -f 1 \
+ | while read -r registry
+ do
+ if printf "%s" "$registry" | grep -q "\\."
+ then
+ printf "%s\n" "$registry"
+ else
+ printf "docker.io\n"
+ fi
+ done \
| sort \
- | uniq -c \
- | cut -d "/" -f 1
+ | uniq -c
}
main "$@"