Skip to content

Commit

Permalink
makefile: create a separate catalog image for deps
Browse files Browse the repository at this point in the history
A separate catalog image will be used in the openshift CI

Signed-off-by: Nitin Goyal <[email protected]>
  • Loading branch information
iamniting committed Apr 2, 2024
1 parent 36a1b6e commit e440ab8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,11 @@ catalog-build: catalog ## Build a catalog image.
.PHONY: catalog-push
catalog-push: ## Push a catalog image.
$(MAKE) docker-push IMG=$(CATALOG_IMG)

.PHONY: catalog-deps-build
catalog-deps-build: catalog ## Build a catalog-deps image.
docker build -f catalog.deps.Dockerfile -t $(CATALOG_DEPS_IMG) .

.PHONY: catalog-deps-push
catalog-deps-push: ## Push a catalog-deps image.
$(MAKE) docker-push IMG=$(CATALOG_DEPS_IMG)
26 changes: 26 additions & 0 deletions catalog.deps.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# The base image which contain rm and sed command
FROM cirros as builder

# Copy catalog files
COPY catalog /configs

# Remove odf bundle from the files
RUN rm -f /configs/odf.yaml

# Remove odf bundle details from the index file
RUN sed -i '1,11d' /configs/index.yaml


# The base image is expected to contain
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
FROM quay.io/operator-framework/opm:v1.26.0

# Configure the entrypoint and command
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs"]

# Copy declarative config root into image at /configs
COPY --from=builder /configs /configs

# Set DC-specific label for the location of the DC root directory in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
4 changes: 4 additions & 0 deletions hack/make-bundle-vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ IMAGE_TAG ?= latest
IMAGE_NAME ?= odf-operator
BUNDLE_IMAGE_NAME ?= $(IMAGE_NAME)-bundle
CATALOG_IMAGE_NAME ?= $(IMAGE_NAME)-catalog
CATALOG_DEPS_IMAGE_NAME ?= $(IMAGE_NAME)-catalog-deps

# IMG defines the image used for the operator.
IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG)
Expand All @@ -64,6 +65,9 @@ BUNDLE_IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(BUNDLE_IMAGE_NAME):$(IMA
# CATALOG_IMG defines the image used for the catalog.
CATALOG_IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(CATALOG_IMAGE_NAME):$(IMAGE_TAG)

# CATALOG_DEPS_IMG defines the image used for the catalog deps.
CATALOG_DEPS_IMG ?= $(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(CATALOG_DEPS_IMAGE_NAME):$(IMAGE_TAG)

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd"

Expand Down

0 comments on commit e440ab8

Please sign in to comment.