Merge pull request #113513 from dims/fix-sample-apiserver-e2e-image-build-failure

Fix sample-apiserver E2E image build failure
This commit is contained in:
Kubernetes Prow Robot 2022-11-02 06:47:27 -07:00 committed by GitHub
commit 07315d10b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,8 +28,11 @@ bin:
docker run --rm -i -v "${TARGET}:${TARGET}:Z" registry.k8s.io/build-image/kube-cross:${KUBE_CROSS_VERSION} \ docker run --rm -i -v "${TARGET}:${TARGET}:Z" registry.k8s.io/build-image/kube-cross:${KUBE_CROSS_VERSION} \
/bin/bash -c "\ /bin/bash -c "\
mkdir -p /go/src /go/bin && \ mkdir -p /go/src /go/bin && \
GO111MODULE=on go get -d k8s.io/sample-apiserver@v0.17.0 && \ git clone https://github.com/kubernetes/sample-apiserver /go/src/k8s.io/sample-apiserver && \
GO111MODULE=on CGO_ENABLED=0 GOARM=${GOARM} GOOS=${OS} GOARCH=${ARCH} go get k8s.io/sample-apiserver@v0.17.0 && \ cd /go/src/k8s.io/sample-apiserver && \
git checkout tags/v0.17.0 && \
go mod tidy && \
GO111MODULE=on CGO_ENABLED=0 GOARM=${GOARM} GOOS=${OS} GOARCH=${ARCH} go install . && \
find /go/bin -name sample-apiserver* -exec cp {} ${TARGET}/sample-apiserver \;" find /go/bin -name sample-apiserver* -exec cp {} ${TARGET}/sample-apiserver \;"
# for arm, go install uses /go/bin/linux_arm, so just find the file and copy it to the # for arm, go install uses /go/bin/linux_arm, so just find the file and copy it to the
# root so we can copy it out from this throw away container image from a standard location. # root so we can copy it out from this throw away container image from a standard location.