diff options
| author | Patrick Spek <p.spek@tyil.nl> | 2026-01-05 10:15:31 +0100 |
|---|---|---|
| committer | Patrick Spek <p.spek@tyil.nl> | 2026-01-05 10:15:31 +0100 |
| commit | f1b6df77affa780c1db8d771edd62d209e2d3b61 (patch) | |
| tree | 4f361d9b5e6920036149041ed30fe814599a8fa8 | |
| parent | af95bc283d2f71140e40a7bbe2c177dd78791bfc (diff) | |
| download | dotfiles-f1b6df77affa780c1db8d771edd62d209e2d3b61.tar.gz dotfiles-f1b6df77affa780c1db8d771edd62d209e2d3b61.tar.bz2 | |
Show docker.io for 'empty' registries
| -rwxr-xr-x | .local/bin/kubectl-registries | 13 |
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 "$@" |
