Skip to content

Commit 34ca656

Browse files
correct chmod in Dockerfile and refactor test
1 parent 0a149c1 commit 34ca656

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ COPY --from=builder kubectl1.12 /usr/local/bin/
1919
COPY --from=builder kubectl1.10 /usr/local/bin/
2020
COPY --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

2424
WORKDIR /
2525

cf-deploy-kubernetes.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ elif (( "${SERVER_VERSION}" <= "6" )); then
8383
KUBE_CTL="6"
8484
fi
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
8792
if [[ -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
98104
fi
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

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

0 commit comments

Comments
 (0)