Skip to content

Commit ba12e76

Browse files
Copilotchefgs
andauthored
Refine kubectl failure messages
Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/8929bee2-ec5e-454a-8614-f771484942ab Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
1 parent eb35f89 commit ba12e76

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ RUN if [ "$INSTALL_TERRAFORM" = "true" ]; then \
125125

126126
# Install kubectl if requested
127127
RUN if [ "$INSTALL_KUBECTL" = "true" ]; then \
128-
KUBECTL_VERSION="$(curl -fsSL https://dl.k8s.io/release/stable.txt)" || (echo "failed to resolve the latest kubectl version" >&2 && exit 1) \
128+
KUBECTL_VERSION="$(curl -fsSL https://dl.k8s.io/release/stable.txt)" || (echo "failed to resolve the latest kubectl version from https://dl.k8s.io/release/stable.txt" >&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" \
131131
&& KUBECTL_SHA256="$(cat /tmp/kubectl.sha256)" \
132132
&& DOWNLOADED_KUBECTL_SHA256="$(sha256sum /tmp/kubectl | cut -d' ' -f1)" \
133-
&& (test "${KUBECTL_SHA256}" = "${DOWNLOADED_KUBECTL_SHA256}" || (echo "kubectl checksum verification failed" >&2 && exit 1)) \
133+
&& (test "${KUBECTL_SHA256}" = "${DOWNLOADED_KUBECTL_SHA256}" || (echo "kubectl checksum verification failed: expected ${KUBECTL_SHA256}, got ${DOWNLOADED_KUBECTL_SHA256}" >&2 && exit 1)) \
134134
&& install -o root -g root -m 0755 /tmp/kubectl /usr/local/bin/kubectl \
135135
&& rm -f /tmp/kubectl /tmp/kubectl.sha256; \
136136
fi

0 commit comments

Comments
 (0)