Skip to content

Commit cadc112

Browse files
Merge pull request #17 from jfahrer/master
Add support for Kubernetes 1.13
2 parents dca00c6 + 7a082e3 commit cadc112

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ RUN apk add --update bash
1515
#copy all versions of kubectl to switch between them later.
1616
COPY --from=builder kubectl1.15 /usr/local/bin/
1717
COPY --from=builder kubectl1.14 /usr/local/bin/
18+
COPY --from=builder kubectl1.10 /usr/local/bin/
1819
COPY --from=builder kubectl1.10 /usr/local/bin/kubectl
1920
COPY --from=builder kubectl1.6 /usr/local/bin/
2021

21-
RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/kubectl1.6 /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.14 /usr/local/bin/kubectl1.15
2223

2324
WORKDIR /
2425

cf-deploy-kubernetes.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,17 @@ fi
6262
#check the cluster version and decide which version of kubectl to use:
6363
SERVER_VERSION=$(kubectl version --short=true --context "${KUBECONTEXT}" | grep -i server | cut -d ':' -f2 | cut -d '.' -f2 | sed 's/[^0-9]*//g')
6464
echo "Server minor version: $SERVER_VERSION"
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
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+
6876
[ ! -f "${deployment_file}" ] && echo "Couldn't find $deployment_file file at $(pwd)" && exit 1;
6977

7078
DEPLOYMENT_FILE=${deployment_file}-$(date '+%y-%m-%d_%H-%M-%S').yml

0 commit comments

Comments
 (0)