File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 22set -e
33
44kubectl=kubectl
5- version=1.8.0
5+ version=1.8.1
66generator=" "
77node=" "
88nodefaultctx=0
@@ -85,9 +85,11 @@ if [ -z "$node" ]; then
8585 exit 1
8686fi
8787
88- # Set the default context and namespace to avoid situations where the user switch them during the build process
89- [ " $nodefaultctx " = 1 ] || kubectl=" $kubectl --context=$( ${kubectl} config current-context) "
90- [ " $nodefaultns " = 1 ] || kubectl=" $kubectl --namespace=$( ${kubectl} config view --minify --output ' jsonpath={.contexts..namespace}' ) "
88+ if [ -z " $KUBERNETES_PORT " ]; then
89+ # Set the default context and namespace to avoid situations where the user switch them during the build process
90+ [ " $nodefaultctx " = 1 ] || kubectl=" $kubectl --context=$( ${kubectl} config current-context) "
91+ [ " $nodefaultns " = 1 ] || kubectl=" $kubectl --namespace=$( ${kubectl} config view --minify --output ' jsonpath={.contexts..namespace}' ) "
92+ fi
9193
9294# Check the node and retrieve the node OS label
9395os=" $( $kubectl get node $node -o jsonpath=" {.metadata.labels.kubernetes\.io/os}" || exit 1) "
You can’t perform that action at this time.
0 commit comments