From 196c254d4d092134631f5c6bac3ae53c6f775a94 Mon Sep 17 00:00:00 2001 From: dbrewster Date: Tue, 9 Jul 2024 21:34:19 -0400 Subject: [PATCH] Enabled buildx for bundle --- .github/workflows/version_k8_op.yml | 2 +- k8s-operator/Makefile | 12 +++++++++++- k8s-operator/config/samples/csv.yaml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/version_k8_op.yml b/.github/workflows/version_k8_op.yml index 9dea7f510..25250f217 100644 --- a/.github/workflows/version_k8_op.yml +++ b/.github/workflows/version_k8_op.yml @@ -55,7 +55,7 @@ jobs: run: make build docker-buildx working-directory: k8s-operator - name: "bundle" - run: make bundle bundle-build bundle-push + run: make bundle bundle-buildx working-directory: k8s-operator - name: "catalog" run: make catalog-build catalog-push diff --git a/k8s-operator/Makefile b/k8s-operator/Makefile index 3b0f09198..246f1d483 100644 --- a/k8s-operator/Makefile +++ b/k8s-operator/Makefile @@ -277,6 +277,16 @@ bundle-push: ## Push the bundle image. bundle-push: ## Push the bundle image. $(MAKE) docker-push IMG=$(BUNDLE_IMG) +.PHONY: bundle-buildx +bundle-buildx: ## Build and push docker image for the manager for cross-platform support + # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile + sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' bundle.Dockerfile > bundle.Dockerfile.cross + - $(CONTAINER_TOOL) buildx create --name project-v3-builder + $(CONTAINER_TOOL) buildx use project-v3-builder + - $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f bundle.Dockerfile.cross . + - $(CONTAINER_TOOL) buildx rm project-v3-builder + rm Dockerfile.cross + .PHONY: opm OPM = $(LOCALBIN)/opm opm: ## Download opm locally if necessary. @@ -299,7 +309,7 @@ endif BUNDLE_IMGS ?= $(BUNDLE_IMG) # The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0). -CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:$(VERSION) +CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:latest # Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image. ifneq ($(origin CATALOG_BASE_IMG), undefined) diff --git a/k8s-operator/config/samples/csv.yaml b/k8s-operator/config/samples/csv.yaml index 22b174cdf..daecdb544 100644 --- a/k8s-operator/config/samples/csv.yaml +++ b/k8s-operator/config/samples/csv.yaml @@ -5,7 +5,7 @@ metadata: namespace: operators spec: sourceType: grpc - image: eidolonai/controller-catalog:v0.0.4 + image: eidolonai/controller-catalog:latest displayName: Eidolon Catalog publisher: dave@augustdata.ai updateStrategy: