From 17daa9837f0251bf751a7c73a379fb2e69224838 Mon Sep 17 00:00:00 2001 From: Everett Toews Date: Thu, 9 Mar 2017 09:59:38 -0600 Subject: [PATCH] Use kubectl config current-context to simplify the instructions --- docs/user-guide/namespaces.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/user-guide/namespaces.md b/docs/user-guide/namespaces.md index d162139358..1ce6861760 100644 --- a/docs/user-guide/namespaces.md +++ b/docs/user-guide/namespaces.md @@ -64,16 +64,8 @@ $ kubectl --namespace= get pods You can permanently save the namespace for all subsequent kubectl commands in that context. -First get your current context: - ```shell -$ export CONTEXT=$(kubectl config view | awk '/current-context/ {print $2}') -``` - -Then update the default namespace: - -```shell -$ kubectl config set-context $CONTEXT --namespace= +$ kubectl config set-context $(kubectl config current-context) --namespace= # Validate it $ kubectl config view | grep namespace: ```