Skip to content

Commit 93fa8b1

Browse files
committed
hack/images: skip envtest download in CI/release
Because of the way in which we rebase and build our kube fork, the binary doesn't have minor versions set correctly. For example, version 1.29.5 appears as `v1.29.0-rc.1.3970+87992f48b0ead9-dirty` and that breaks the version detection in our scripts. Since we already have pre-built binaries in CI/release, there is no reason for downloading those binaries. The only case in which it's needed is for local dev. So we introduce an env var `SKIP_ENVTEST` to skip the download when building images.
1 parent 36f4a6b commit 93fa8b1

File tree

8 files changed

+10
-2
lines changed

8 files changed

+10
-2
lines changed

hack/build-cluster-api.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ copy_cluster_api_to_mirror() {
1515
# Clean the mirror, but preserve the README file.
1616
rm -rf "${CLUSTER_API_MIRROR_DIR:?}/*.zip"
1717

18-
sync_envtest
18+
if test "${SKIP_ENVTEST}" != y; then
19+
sync_envtest
20+
fi
1921

2022
# Zip every binary in the folder into a single zip file.
2123
zip -j1 "${CLUSTER_API_MIRROR_DIR}/cluster-api.zip" "${CLUSTER_API_BIN_DIR}"/*

images/baremetal/Dockerfile.ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ FROM registry.ci.openshift.org/ocp/4.16:hyperkube AS kas
77

88
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
99
ARG TAGS="baremetal fipscapable"
10+
ARG SKIP_ENVTEST="y"
1011
WORKDIR /go/src/github.com/openshift/installer
1112
COPY . .
1213
COPY --from=etcd /usr/bin/etcd /usr/bin/etcd

images/installer-altinfra/Dockerfile.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.17 AS
1515
# FIPS support is offered via the baremetal-installer image
1616
ENV GO_COMPLIANCE_EXCLUDE=".*"
1717
ARG TAGS="altinfra"
18-
ARG OPENSHIFT_INSTALL_CLUSTER_API=""
18+
ARG SKIP_ENVTEST="y"
1919
WORKDIR /go/src/github.com/openshift/installer
2020
COPY . .
2121
COPY --from=kas-artifacts /usr/share/openshift/ cluster-api/bin/

images/installer-artifacts/Dockerfile.rhel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ RUN GOOS=linux GOARCH=amd64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
4141
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.17 AS linuxarmbuilder
4242
ENV GO_COMPLIANCE_EXCLUDE=".*"
4343
ARG TAGS=""
44+
ARG SKIP_ENVTEST="y"
4445
WORKDIR /go/src/github.com/openshift/installer
4546
COPY . .
4647
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/linux_arm64 terraform/bin/linux_arm64

images/installer/Dockerfile.ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.17 AS
1010
# FIPS support is offered via the baremetal-installer image
1111
ENV GO_COMPLIANCE_EXCLUDE=".*"
1212
ARG TAGS=""
13+
ARG SKIP_ENVTEST="y"
1314
WORKDIR /go/src/github.com/openshift/installer
1415
COPY . .
1516
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/

images/installer/Dockerfile.upi.ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS
1111
# FIPS support is offered via the baremetal-installer image
1212
ENV GO_COMPLIANCE_EXCLUDE=".*"
1313
ARG TAGS=""
14+
ARG SKIP_ENVTEST="y"
1415
WORKDIR /go/src/github.com/openshift/installer
1516
COPY . .
1617
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/

images/libvirt/Dockerfile.ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ FROM registry.ci.openshift.org/ocp/4.16:hyperkube AS kas
88

99
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
1010
ARG TAGS="libvirt fipscapable"
11+
ARG SKIP_ENVTEST="y"
1112
WORKDIR /go/src/github.com/openshift/installer
1213
COPY . .
1314
COPY --from=etcd /usr/bin/etcd /usr/bin/etcd

images/openstack/Dockerfile.ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS
99
# FIPS support is offered via the baremetal-installer image
1010
ENV GO_COMPLIANCE_EXCLUDE=".*"
1111
ARG TAGS=""
12+
ARG SKIP_ENVTEST="y"
1213
WORKDIR /go/src/github.com/openshift/installer
1314
COPY . .
1415
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/

0 commit comments

Comments
 (0)