File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,10 +125,12 @@ RUN if [ "$INSTALL_TERRAFORM" = "true" ]; then \
125125
126126# Install kubectl if requested
127127RUN if [ "$INSTALL_KUBECTL" = "true" ]; then \
128- KUBECTL_VERSION="$(curl -fsSL https://dl.k8s.io/release/stable.txt)" \
128+ KUBECTL_VERSION="$(curl -fsSL https://dl.k8s.io/release/stable.txt)" || (echo "failed to resolve the latest kubectl version" >&2 && exit 1) \
129129 && curl -fsSLo /tmp/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl" \
130130 && curl -fsSLo /tmp/kubectl.sha256 "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl.sha256" \
131- && (test "$(cat /tmp/kubectl.sha256)" = "$(sha256sum /tmp/kubectl | cut -d' ' -f1)" || (echo "kubectl checksum verification failed" >&2 && exit 1)) \
131+ && KUBECTL_SHA256="$(cat /tmp/kubectl.sha256)" \
132+ && DOWNLOADED_KUBECTL_SHA256="$(sha256sum /tmp/kubectl | cut -d' ' -f1)" \
133+ && (test "${KUBECTL_SHA256}" = "${DOWNLOADED_KUBECTL_SHA256}" || (echo "kubectl checksum verification failed" >&2 && exit 1)) \
132134 && install -o root -g root -m 0755 /tmp/kubectl /usr/local/bin/kubectl \
133135 && rm -f /tmp/kubectl /tmp/kubectl.sha256; \
134136 fi
You can’t perform that action at this time.
0 commit comments