Skip to content

Commit

Permalink
Enabled buildx for bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrewster committed Jul 10, 2024
1 parent e73da47 commit 196c254
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/version_k8_op.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion k8s-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion k8s-operator/config/samples/csv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 196c254

Please sign in to comment.