Skip to content

Commit 33083a9

Browse files
fanqiehczhanghc
andauthored
fix: kubectl command alias in getting ctx and ns (#23)
Co-authored-by: zhanghc <zhanghc@keyamedical.com>
1 parent aae8212 commit 33083a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kubectl-node_shell

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ while [ $# -gt 0 ]; do
6565
done
6666

6767
# Set the default context and namespace to avoid situations where the user switch them during the build process
68-
[ "$nodefaultctx" = 1 ] || kubectl="$kubectl --context=$(kubectl config current-context)"
69-
[ "$nodefaultns" = 1 ] || kubectl="$kubectl --namespace=$(kubectl config view --minify --output 'jsonpath={.contexts..namespace}')"
68+
[ "$nodefaultctx" = 1 ] || kubectl="$kubectl --context=$(${kubectl} config current-context)"
69+
[ "$nodefaultns" = 1 ] || kubectl="$kubectl --namespace=$(${kubectl} config view --minify --output 'jsonpath={.contexts..namespace}')"
7070

7171
while [ $# -gt 0 ]; do
7272
cmd="$cmd\"$1\", "

0 commit comments

Comments
 (0)