Improved command to get namespaces

Previous command had flags like `-A` which make no sense when getting namespaces. Removed dependence on `jq` binary.
This commit is contained in:
David Noland
2021-01-04 15:47:44 -08:00
committed by GitHub
parent f632ba25ff
commit 7ebcfc64ad
@@ -89,7 +89,7 @@ Create a bash script file called `account_update.sh`. Be sure to `chmod +x accou
``` ```
#!/bin/bash -e #!/bin/bash -e
for namespace in $(kubectl get namespaces -A -o json | jq -r '.items[].metadata.name'); do for namespace in $(kubectl get namespaces -o custom-columns=NAME:.metadata.name --no-headers); do
kubectl patch serviceaccount default -n ${namespace} -p "$(cat account_update.yaml)" kubectl patch serviceaccount default -n ${namespace} -p "$(cat account_update.yaml)"
done done
``` ```