summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@datawire.io>2020-07-27 14:32:12 -0600
committerLuke Shumaker <lukeshu@datawire.io>2020-07-27 14:32:12 -0600
commit9adc8a2aeaf034f5172b32c9bd000c686465ab21 (patch)
tree4c58f2dc3202d8dcf78007f75053e58cf58adfcc
parent14cd5da53289a76ccc50cc24e66f936c5bb19b61 (diff)
kubectl-get-all: Parallelism
-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"