Skip to content

Commit 071d27e

Browse files
authored
More clarification according to the discussion
1 parent dc9f8bf commit 071d27e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/en/docs/reference/kubectl/cheatsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ kubectl config set-context gce --user=cluster-admin --namespace=foo \
7474

7575
kubectl config unset users.foo # delete user foo
7676

77-
# short alias to set/show context/namespace
78-
alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace | cut -d" " -f6 ; } ; f'
77+
# short alias to set/show context/namespace (only works for bash and bash-compatible shells, current context to be set before using kn to set namespace)
7978
alias kx='f() { [ "$1" ] && kubectl config use-context $1 || kubectl config current-context ; } ; f'
79+
alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace | cut -d" " -f6 ; } ; f'
8080
```
8181

8282
## Kubectl apply

0 commit comments

Comments
 (0)