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: ```