mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-12 04:05:50 +00:00
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:
@@ -89,7 +89,7 @@ Create a bash script file called `account_update.sh`. Be sure to `chmod +x accou
|
||||
```
|
||||
#!/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)"
|
||||
done
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user