From 0e13150c7f03d36185eb443128be185e3ec4c88a Mon Sep 17 00:00:00 2001 From: Varad Ahirwadkar Date: Tue, 3 Sep 2024 12:09:20 +0530 Subject: [PATCH] Use File-Based Catalog Format --- Makefile | 8 +++++++- catalog/preamble_config_template.json | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 catalog/preamble_config_template.json diff --git a/Makefile b/Makefile index 4a7e2f9..3a574d7 100644 --- a/Makefile +++ b/Makefile @@ -304,7 +304,13 @@ endif # https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator .PHONY: catalog-build catalog-build: opm ## Build a catalog image. - $(OPM) index add --container-tool $(CONTAINER_TOOL) --mode semver --tag $(CATALOG_IMG) -i quay.io/operator-framework/opm:$(OPM_VERSION)-ppc64le --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) + $(eval TMP_DIR := $(shell mktemp -d)) + $(eval CATALOG_DOCKERFILE := $(TMP_DIR).Dockerfile) + @envsubst < catalog/preamble_config_template.json > catalog/preamble_config.json + cp catalog/preamble_config.json $(TMP_DIR)/rsct-operator-catalog.json + $(OPM) render $(BUNDLE_IMGS) >> $(TMP_DIR)/rsct-operator-catalog.json + $(OPM) generate dockerfile $(TMP_DIR) -i quay.io/operator-framework/opm:$(OPM_VERSION)-ppc64le + $(CONTAINER_TOOL) build -f $(CATALOG_DOCKERFILE) -t $(CATALOG_IMG) # Push the catalog image. .PHONY: catalog-push diff --git a/catalog/preamble_config_template.json b/catalog/preamble_config_template.json new file mode 100644 index 0000000..9162568 --- /dev/null +++ b/catalog/preamble_config_template.json @@ -0,0 +1,15 @@ +{ + "schema": "olm.package", + "name": "rsct-operator", + "defaultChannel": "alpha" +} +{ + "schema": "olm.channel", + "name": "alpha", + "package": "rsct-operator", + "entries": [ + { + "name": "rsct-operator.v${VERSION}" + } + ] +} \ No newline at end of file