From 54af88fad2c3ee7f7e1fb483402c7ee0f691a1f0 Mon Sep 17 00:00:00 2001 From: Pengcheng Chen Date: Thu, 26 Sep 2019 04:25:06 +0200 Subject: [PATCH] Update the kubectl config command in cheatsheet.md (#16556) `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}' ` --- content/en/docs/reference/kubectl/cheatsheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 7da797476b820..d6a7c441c8553 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -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