From b4351e8261c8bf3c2bc16c940115ea0a77b86940 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Tue, 9 Apr 2024 12:54:41 +1200 Subject: [PATCH 1/2] Use new build tag to differentiate dynamic build When we linked to libvirt directly, having the libvirt platform in the build was synonymous with a dynamically linked build. Now that we use a pure-Go libvirt library, the build type can be independent of whether libvirt is included. Once the baremetal installer build no longer includes the libvirt platform, we still want it to be dynamically linked. --- hack/build.sh | 2 +- images/baremetal/Dockerfile.ci | 2 +- images/libvirt/Dockerfile.ci | 2 +- pkg/hostcrypt/dynamic.go | 4 ++-- pkg/hostcrypt/static.go | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hack/build.sh b/hack/build.sh index 9571113a97..1411db143f 100755 --- a/hack/build.sh +++ b/hack/build.sh @@ -113,7 +113,7 @@ then GOOS='' GOARCH='' go generate ./data fi -if (echo "${TAGS}" | grep -q 'libvirt') +if (echo "${TAGS}" | grep -q '\bfipscapable\b') then export CGO_ENABLED=1 fi diff --git a/images/baremetal/Dockerfile.ci b/images/baremetal/Dockerfile.ci index 4b44a08759..296e526f2c 100644 --- a/images/baremetal/Dockerfile.ci +++ b/images/baremetal/Dockerfile.ci @@ -2,7 +2,7 @@ # It builds an image containing openshift-install. FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder -ARG TAGS="libvirt baremetal" +ARG TAGS="libvirt baremetal fipscapable" WORKDIR /go/src/github.com/openshift/installer COPY . . RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh diff --git a/images/libvirt/Dockerfile.ci b/images/libvirt/Dockerfile.ci index fbfc631c38..4a3f086ea5 100644 --- a/images/libvirt/Dockerfile.ci +++ b/images/libvirt/Dockerfile.ci @@ -3,7 +3,7 @@ # oc for getting assets from an existing cluster to spin up multi-architecture compute clusters on libvirt. FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder -ARG TAGS="libvirt" +ARG TAGS="libvirt fipscapable" WORKDIR /go/src/github.com/openshift/installer COPY . . RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh diff --git a/pkg/hostcrypt/dynamic.go b/pkg/hostcrypt/dynamic.go index 5bf54fc52c..dcb48496c4 100644 --- a/pkg/hostcrypt/dynamic.go +++ b/pkg/hostcrypt/dynamic.go @@ -1,5 +1,5 @@ -//go:build libvirt -// +build libvirt +//go:build fipscapable +// +build fipscapable package hostcrypt diff --git a/pkg/hostcrypt/static.go b/pkg/hostcrypt/static.go index 6eb0e5efbe..049b96cf75 100644 --- a/pkg/hostcrypt/static.go +++ b/pkg/hostcrypt/static.go @@ -1,5 +1,5 @@ -//go:build !libvirt -// +build !libvirt +//go:build !fipscapable +// +build !fipscapable package hostcrypt From 3d3c2d191d0cc137b122a6fe4626174151482e0d Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Tue, 9 Apr 2024 12:58:55 +1200 Subject: [PATCH 2/2] CORS-3420: Remove libvirt platform from openshift-baremetal-install --- images/baremetal/Dockerfile.ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/baremetal/Dockerfile.ci b/images/baremetal/Dockerfile.ci index 296e526f2c..e24228fdbf 100644 --- a/images/baremetal/Dockerfile.ci +++ b/images/baremetal/Dockerfile.ci @@ -2,7 +2,7 @@ # It builds an image containing openshift-install. FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder -ARG TAGS="libvirt baremetal fipscapable" +ARG TAGS="baremetal fipscapable" WORKDIR /go/src/github.com/openshift/installer COPY . . RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh