Skip to content

Commit

Permalink
Merge pull request #45 from varad-ahirwadkar/main
Browse files Browse the repository at this point in the history
Use File-Based Catalog Format
  • Loading branch information
Power Cloud Robot authored Oct 23, 2024
2 parents 9c97e84 + 9219129 commit 7746908
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,17 @@ 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)
$(shell mkdir rsct-temp)
$(eval TMP_DIR := rsct-temp)
@envsubst < catalog/preamble_config_template.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}
## Apending Final stage for ppc64le
echo "FROM quay.io/operator-framework/opm:$(OPM_VERSION)-ppc64le" >> $(TMP_DIR).Dockerfile
cat catalog/Dockerfile_final_stage >> $(TMP_DIR).Dockerfile
## Building catalog image
$(CONTAINER_TOOL) build -f $(TMP_DIR).Dockerfile -t $(CATALOG_IMG)
rm -rf $(TMP_DIR)

# Push the catalog image.
.PHONY: catalog-push
Expand Down
9 changes: 9 additions & 0 deletions catalog/Dockerfile_final_stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

ADD rsct-temp /configs
COPY --from=0 /tmp/cache /tmp/cache

# Configure the entrypoint and command
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

LABEL operators.operatorframework.io.index.configs.v1=/configs
15 changes: 15 additions & 0 deletions catalog/preamble_config_template.json
Original file line number Diff line number Diff line change
@@ -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}"
}
]
}

0 comments on commit 7746908

Please sign in to comment.