Skip to content

Commit

Permalink
makefile: move to filebased catalog source
Browse files Browse the repository at this point in the history
as sqlite based catalog source is depricarted, move to file based
catalogsource

Signed-off-by: Rewant Soni <[email protected]>
  • Loading branch information
rewantsoni committed Apr 3, 2024
1 parent 9807312 commit 05f59b7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
bin/
testbin/

catalog
catalog.Dockerfile

# Created by https://www.toptal.com/developers/gitignore/api/go,vim,visualstudiocode,git
# Edit at https://www.toptal.com/developers/gitignore?templates=go,vim,visualstudiocode,git

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ bundle-push: ## Push the bundle image.
# 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 --permissive --container-tool $(IMAGE_BUILD_CMD) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT)
./hack/build-catalog.sh

# Push the catalog image.
.PHONY: catalog-push
Expand Down
36 changes: 36 additions & 0 deletions hack/build-catalog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

rm -rf catalog
rm -rf catalog.Dockerfile

mkdir catalog

${OPM} render --output=yaml ${BUNDLE_IMG} > catalog/ocs-client-bundle.yaml
${OPM} render --output=yaml ${CSI_ADDONS_BUNDLE_IMG} > catalog/csi-adddons-bundle.yaml

cat << EOF >> catalog/index.yaml
---
defaultChannel: alpha
name: $IMAGE_NAME
schema: olm.package
---
schema: olm.channel
package: ocs-client-operator
name: alpha
entries:
- name: $IMAGE_NAME.v$VERSION
---
defaultChannel: alpha
name: $CSI_ADDONS_PACKAGE_NAME
schema: olm.package
---
schema: olm.channel
package: csi-addons
name: alpha
entries:
- name: $CSI_ADDONS_PACKAGE_NAME.v$CSI_ADDONS_PACKAGE_VERSION
EOF

${OPM} validate catalog
${OPM} generate dockerfile catalog
${IMAGE_BUILD_CMD} build --platform="linux/amd64" -t ${CATALOG_IMG} -f catalog.Dockerfile .
2 changes: 1 addition & 1 deletion hack/make-bundle-vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ endif

# csi-addons dependencies
CSI_ADDONS_PACKAGE_NAME ?= csi-addons
CSI_ADDONS_PACKAGE_VERSION ?= "0.5.0"
CSI_ADDONS_PACKAGE_VERSION ?= 0.5.0

## CSI driver images
# The following variables define the default CSI container images to deploy
Expand Down

0 comments on commit 05f59b7

Please sign in to comment.