Skip to content

Commit

Permalink
Update the kubectl config command in cheatsheet.md (#16556)
Browse files Browse the repository at this point in the history
`kubectl config view -o jsonpath='{.users[].name}' ` in the doc doesn't get the list of users as described in the comment actually.
To get the list of users, the json path should be `'{.users[].name}' `
  • Loading branch information
Pc6 authored and k8s-ci-robot committed Sep 26, 2019
1 parent 3a2a59c commit 54af88f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/en/docs/reference/kubectl/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ kubectl config view
# get the password for the e2e user
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'

kubectl config view -o jsonpath='{.users[].name}' # get a list of users
kubectl config view -o jsonpath='{.users[*].name}' # get a list of users
kubectl config get-contexts # display list of contexts
kubectl config current-context # display the current-context
kubectl config use-context my-cluster-name # set the default context to my-cluster-name
Expand Down

0 comments on commit 54af88f

Please sign in to comment.