File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ COPY --from=builder kubectl1.12 /usr/local/bin/
1919COPY --from=builder kubectl1.10 /usr/local/bin/
2020COPY --from=builder kubectl1.6 /usr/local/bin/
2121
22- RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl1.10 /usr/local/bin/kubectl1.12 /usr/local/bin/kubectl1.14 /usr/local/bin/kubectl1. 15
22+ RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl1.10 /usr/local/bin/kubectl1.12 /usr/local/bin/kubectl1.15
2323
2424WORKDIR /
2525
Original file line number Diff line number Diff line change @@ -83,9 +83,15 @@ elif (( "${SERVER_VERSION}" <= "6" )); then
8383 KUBE_CTL=" 6"
8484fi
8585
86+ # Assign kubectl version unless default
87+ if (( "$KUBE_CTL " != "14 " )) ; then
88+ cp -f /usr/local/bin/kubectl1.${KUBE_CTL} /usr/local/bin/kubectl
89+ fi
90+
8691# Simple testing logic for making sure versions are set
8792if [[ -z " ${KUBE_CTL_TEST_VERSION} " ]]; then
88- if [ " ${KUBE_CTL} " == " ${KUBE_CTL_TEST_VERSION} " ]; then
93+ KUBE_CTL_VERSION=` kubectl version --client --short`
94+ if [[ " ${KUBE_CTL_VERSION} " == * " ${KUBE_CTL_TEST_VERSION} " * ]]; then
8995 echo " Version correctly set"
9096 echo " Kubectl Version: ${KUBE_CTL} "
9197 echo " Test Version: ${KUBE_CTL_TEST_VERSION} "
@@ -97,11 +103,6 @@ if [[ -z "${KUBE_CTL_TEST_VERSION}" ]]; then
97103 exit 1
98104fi
99105
100- # Assign kubectl version unless default
101- if (( "$KUBE_CTL " != "14 " )) ; then
102- cp -f /usr/local/bin/kubectl1.${KUBE_CTL} /usr/local/bin/kubectl
103- fi
104-
105106[ ! -f " ${deployment_file} " ] && echo " Couldn't find $deployment_file file at $( pwd) " && exit 1;
106107
107108DEPLOYMENT_FILE=${deployment_file} -$( date ' +%y-%m-%d_%H-%M-%S' ) .yml
You can’t perform that action at this time.
0 commit comments