File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Tests/kaas/kaas-sonobuoy-go-example-e2e-framework Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 11FROM golang:1.23
22
3- # Install kubectl
4- # Note: Latest version may be found on:
5- # https://aur.archlinux.org/packages/kubectl-bin/
6- RUN wget https://storage.googleapis.com/kubernetes-release/release/v1.21.3/bin/linux/amd64/kubectl -O /usr/bin/kubectl && \
7- chmod +x /usr/bin/kubectl && \
8- apt-get update && \
9- apt-get install -y jq
3+ # Use build arguments to get the correct architecture
4+ ARG TARGETARCH
5+
6+ # Install kubectl based on the architecture
7+ # See https://github.com/kubernetes-sigs/kubespray/pull/10066
8+ RUN apt-get update && apt-get install -y wget jq && \
9+ if [ "$TARGETARCH" = "amd64" ]; then \
10+ wget https://cdn.dl.k8s.io/release/v1.31.1/bin/linux/amd64/kubectl -O /usr/bin/kubectl; \
11+ elif [ "$TARGETARCH" = "arm64" ]; then \
12+ wget https://cdn.dl.k8s.io/release/v1.31.1/bin/linux/arm64/kubectl -O /usr/bin/kubectl; \
13+ else \
14+ echo "Unsupported architecture: $TARGETARCH" && exit 1; \
15+ fi && \
16+ chmod +x /usr/bin/kubectl
1017
1118COPY ./scs_k8s_tests /src/scs_k8s_tests
1219WORKDIR /src
@@ -19,5 +26,3 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
1926 go test -c -o custom.test ./...
2027
2128CMD ["bash" , "-c" , "go tool test2json ./custom.test -test.v" ]
22-
23-
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ dev-prerequests:
5757 @docker version
5858 @sonobuoy version --short
5959 @go version
60+ @docker buildx version
6061
6162
6263dev-setup : kind-init
You can’t perform that action at this time.
0 commit comments