Skip to content

Fix broken catalog-build-from-index command #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ catalog-build-from-index: opm ## Build a catalog image.
mkdir catalog
$(OPM) render $(CATALOG_BASE_IMG) -o yaml > catalog/bundles.yaml
$(OPM) render $(BUNDLE_IMG) $(OPM_BUNDLE_OPT) > catalog/codeflare-operator-bundle.yaml
$(SED) -i -E "s/(.*)(- name: codeflare-operator.$(PREVIOUS_VERSION).*)/\1- name: codeflare-operator.$(VERSION)\n replaces: codeflare-operator.$(PREVIOUS_VERSION)\n\2/" catalog/bundles.yaml
$(SED) -i -E "s/(.*)(- name: codeflare-operator.v0.2.0)/\1- name: codeflare-operator.$(VERSION)\n replaces: codeflare-operator.$(PREVIOUS_VERSION)\n\2/" catalog/bundles.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excuse my lack of sed knowledge here but are we now hardcoding a version? is this PR just for this fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this line is to inject replacing entry into the bundle section, where replacing entries are kept.
Originally this new replacing entry is placed right before last CodeFlare operator entry, however due to the regex issues with v1.0.0 the injection was duplicated. By fixing the searched text I made sure that only one injection is done.

Anyway this code is used just for tests, for real OLM release this bundle index is generated in OLM repo, we just provide manifests.

$(OPM) validate catalog
$(OPM) generate dockerfile catalog
podman build . -f catalog.Dockerfile -t $(CATALOG_IMG)
Expand Down