summaryrefslogtreecommitdiff
path: root/.local/bin/kubectl-get-all
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/kubectl-get-all')
-rwxr-xr-x.local/bin/kubectl-get-all6
1 files changed, 5 insertions, 1 deletions
diff --git a/.local/bin/kubectl-get-all b/.local/bin/kubectl-get-all
index ce66743..f4707d5 100755
--- a/.local/bin/kubectl-get-all
+++ b/.local/bin/kubectl-get-all
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
+tmpdir="$(mktemp -d)"
+trap 'rm -rf -- "$tmpdir"' EXIT
+
if [[ $# -eq 0 ]]; then
kubectl api-resources --namespaced=true -o name | xargs printf '%s true\n'
kubectl api-resources --namespaced=false -o name | xargs printf '%s false\n'
@@ -15,5 +18,6 @@ fi | while read -r type namespaced; do
else
kubectl get "$type" --output=json 2>/dev/null |
jq -r '.items[]|($ENV.type + "/" + .metadata.name)'
- fi
+ fi >"$tmpdir/$type" &
done
+grep -r ^ "$tmpdir"