Skip to content

Commit

Permalink
hack/images: skip envtest download in CI/release
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
r4f4 committed May 25, 2024
1 parent 36f4a6b commit 93fa8b1
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion hack/build-cluster-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ copy_cluster_api_to_mirror() {
# Clean the mirror, but preserve the README file.
rm -rf "${CLUSTER_API_MIRROR_DIR:?}/*.zip"

sync_envtest
if test "${SKIP_ENVTEST}" != y; then
sync_envtest
fi

# Zip every binary in the folder into a single zip file.
zip -j1 "${CLUSTER_API_MIRROR_DIR}/cluster-api.zip" "${CLUSTER_API_BIN_DIR}"/*
Expand Down
1 change: 1 addition & 0 deletions images/baremetal/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FROM registry.ci.openshift.org/ocp/4.16:hyperkube AS kas

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS="baremetal fipscapable"
ARG SKIP_ENVTEST="y"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=etcd /usr/bin/etcd /usr/bin/etcd
Expand Down
2 changes: 1 addition & 1 deletion images/installer-altinfra/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.17 AS
# FIPS support is offered via the baremetal-installer image
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS="altinfra"
ARG OPENSHIFT_INSTALL_CLUSTER_API=""
ARG SKIP_ENVTEST="y"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/ cluster-api/bin/
Expand Down
1 change: 1 addition & 0 deletions images/installer-artifacts/Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN GOOS=linux GOARCH=amd64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.17 AS linuxarmbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/linux_arm64 terraform/bin/linux_arm64
Expand Down
1 change: 1 addition & 0 deletions images/installer/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.17 AS
# FIPS support is offered via the baremetal-installer image
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
Expand Down
1 change: 1 addition & 0 deletions images/installer/Dockerfile.upi.ci
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS
# FIPS support is offered via the baremetal-installer image
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
Expand Down
1 change: 1 addition & 0 deletions images/libvirt/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ FROM registry.ci.openshift.org/ocp/4.16:hyperkube AS kas

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS="libvirt fipscapable"
ARG SKIP_ENVTEST="y"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=etcd /usr/bin/etcd /usr/bin/etcd
Expand Down
1 change: 1 addition & 0 deletions images/openstack/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS
# FIPS support is offered via the baremetal-installer image
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
Expand Down

0 comments on commit 93fa8b1

Please sign in to comment.