Skip to content

Commit 9dc954c

Browse files
committed
make: Build a file-based catalog
Since OLM is deprecating the SQLite based catalog we are currently using, while at the same time, the SQLite based catalogs have issues interacting with OpenShift clusters that implement the recent PSA changes, let's switch to file-based catalog: https://olm.operatorframework.io/docs/reference/file-based-catalogs/ Most of the work is done by the "opm render" command except for some metadata that is stored at catalog/preamble.json, for example the icon. Jira: CMP-1603
1 parent 0edd817 commit 9dc954c

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic
66
Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased] - Date TBD
9+
10+
### Changes
11+
- the upstream catalog image is now built using the
12+
[file format](https://olm.operatorframework.io/docs/reference/file-based-catalogs/)
13+
replacing the now deprecated SQLite format.
14+
15+
### Fixes
16+
17+
### Internal Changes
18+
819
## [0.1.30] - 2022-07-25
920

1021
### Fixes

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ endif
268268
update-skip-range: check-operator-version
269269
sed -i '/replaces:/d' config/manifests/bases/file-integrity-operator.clusterserviceversion.yaml
270270
sed -i "s/\(olm.skipRange: '>=.*\)<.*'/\1<$(VERSION)'/" config/manifests/bases/file-integrity-operator.clusterserviceversion.yaml
271+
sed -i "s/\(\"name\": \"file-integrity-operator.v\).*\"/\1$(VERSION)\"/" catalog/preamble.json
272+
sed -i "s/\(\"skipRange\": \">=.*\)<.*\"/\1<$(VERSION)\"/" catalog/preamble.json
271273

272274
.PHONY: namespace
273275
namespace:
@@ -317,7 +319,13 @@ bundle-image: bundle ## Build the bundle image.
317319
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
318320
.PHONY: catalog-image
319321
catalog-image: opm ## Build a catalog image.
320-
$(OPM) index add --container-tool $(RUNTIME) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT)
322+
$(eval TMP_DIR := $(shell mktemp -d))
323+
$(eval CATALOG_DOCKERFILE := $(TMP_DIR).Dockerfile)
324+
cp catalog/preamble.json $(TMP_DIR)/file-integrity-operator-catalog.json
325+
$(OPM) render $(BUNDLE_IMGS) >> $(TMP_DIR)/file-integrity-operator-catalog.json
326+
$(OPM) generate dockerfile $(TMP_DIR)
327+
$(RUNTIME) build -f $(CATALOG_DOCKERFILE) -t $(CATALOG_IMG)
328+
rm -rf $(TMP_DIR) $(CATALOG_DOCKERFILE)
321329

322330
.PHONY: catalog
323331
catalog: catalog-image catalog-push ## Build and push a catalog image.

0 commit comments

Comments
 (0)