Skip to content

Commit cf26fd1

Browse files
Fix the version check
1 parent 72e5ceb commit cf26fd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cf-deploy-kubernetes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ else
3838
fi
3939

4040
#check the cluster version and decide which version of kubectl to use:
41-
SERVER_VERSION=$(kubectl version --short=true | grep -i server | cut -c18-20 | tr -d .)
41+
SERVER_VERSION=$(kubectl version --short=true --context "${KUBECONTEXT}" | grep -i server | cut -c18-20 | tr -d .)
4242

43-
if (( "$SERVER_VERSION" <= "16" )); then mv /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl; fi
43+
if (( "$SERVER_VERSION" <= "16" )); then mv /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl; fi 2>/dev/null
4444

4545

4646
[ ! -f "${deployment_file}" ] && echo "Couldn't find $deployment_file file at $(pwd)" && exit 1;

0 commit comments

Comments
 (0)