File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,10 @@ RUN apk add --update bash
15
15
# copy all versions of kubectl to switch between them later.
16
16
COPY --from=builder kubectl1.15 /usr/local/bin/
17
17
COPY --from=builder kubectl1.14 /usr/local/bin/
18
- COPY --from=builder kubectl1.10 /usr/local/bin/
19
18
COPY --from=builder kubectl1.10 /usr/local/bin/kubectl
20
19
COPY --from=builder kubectl1.6 /usr/local/bin/
21
20
22
- RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl1.10 /usr/local/bin/kubectl1. 14 /usr/local/bin/kubectl1.15
21
+ RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl1.14 /usr/local/bin/kubectl1.15
23
22
24
23
WORKDIR /
25
24
Original file line number Diff line number Diff line change 62
62
# check the cluster version and decide which version of kubectl to use:
63
63
SERVER_VERSION=$( kubectl version --short=true --context " ${KUBECONTEXT} " | grep -i server | cut -d ' :' -f2 | cut -d ' .' -f2 | sed ' s/[^0-9]*//g' )
64
64
echo " Server minor version: $SERVER_VERSION "
65
- if (( "$SERVER_VERSION " <= "6 " )) ; then
66
- KUBECTL_MINOR_VERSION=6
67
- elif (( "$SERVER_VERSION " <= "12 " )) ; then
68
- KUBECTL_MINOR_VERSION=10
69
- elif (( "$SERVER_VERSION " <= "14 " )) ; then
70
- KUBECTL_MINOR_VERSION=14
71
- elif (( "$SERVER_VERSION " >= "15 " )) ; then
72
- KUBECTL_MINOR_VERSION=15
73
- fi
74
- cp -f /usr/local/bin/kubectl1.$KUBECTL_MINOR_VERSION /usr/local/bin/kubectl > 2> /dev/null
75
-
65
+ if (( "$SERVER_VERSION " <= "6 " )) ; then cp -f /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl; fi 2> /dev/null
66
+ if (( "$SERVER_VERSION " == "14 " )) ; then cp -f /usr/local/bin/kubectl1.14 /usr/local/bin/kubectl; fi 2> /dev/null
67
+ if (( "$SERVER_VERSION " >= "15 " )) ; then cp -f /usr/local/bin/kubectl1.15 /usr/local/bin/kubectl; fi 2> /dev/null
76
68
[ ! -f " ${deployment_file} " ] && echo " Couldn't find $deployment_file file at $( pwd) " && exit 1;
77
69
78
70
DEPLOYMENT_FILE=${deployment_file} -$( date ' +%y-%m-%d_%H-%M-%S' ) .yml
You can’t perform that action at this time.
0 commit comments