- Notifications
You must be signed in to change notification settings - Fork 37
operator-sdk-builds-catalogs: catalog builds in operator-sdk #59
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
operator-sdk-builds-catalogs: catalog builds in operator-sdk #59
Conversation
Signed-off-by: Eric Stroczynski <ericstroczynski@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question, a couple minor change requests.
+IMAGE_TAG_BASE ?= quay.io/example/my-operator | ||
-BUNDLE_IMG ?= controller-bundle:$(VERSION) | ||
+BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change, but would it be considered a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this is just a convenience thing.
catalog-build: opm | ||
$(OPM) index add --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) | ||
| ||
catalog-push: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make sure we comment each of these targets. I think Camila recently did a PR adding comments to various parts of the generated makefiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is important. My POC PR has a bunch of Makefile comments.
catalog-build: opm | ||
$(OPM) index add --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
If I want to use an existing catalog image I assume I could just do:
make catalog-build CATALOG_IMG=quay.io/me/my-image-with-deps:dev
And then we will add our bundle to that existing image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's actually another flag --from-index
you'd use to build from an existing index image. Since the base image doesn't actually exist anywhere (opm index add
builds it for you), I've opted not to include this flag. Perhaps a Makefile comment about this flag would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this comment @estroz , --from-index
is for cumulative builds. It allows you to add a single bundle to an existing index by pulling the old index down, pulling the content onto local disk, appending to it, and then building a new index without having to pull all the bundles every time you just want to update your existing set. Are we saying that the usecase for the sdk expects their users to keep historical record of all previous bundle images locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we saying that the usecase for the sdk expects their users to keep historical record of all previous bundle images locally?
I don't think "keep a historical record of all previous bundle images locally" is a requirement. Hence, it's better to allow users to add a new bundle image (and potentially its dependencies from other Operators) to an existing catalog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--from-index
is for cumulative builds
That's what I intend users to do.
Are we saying that the usecase for the sdk expects their users to keep historical record of all previous bundle images locally
Definitely not, that's what git is for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just trying to point out that --from-index
is a pretty core piece of functionality that we expect all of our opm users to be using aside from the first time they publish an index. It seems odd to differ that fundamentally from how most folks are using the tool now. Or maybe I'm just totally misreading this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its more a problem of defaults than differentiating behavior. There is no default image to set --from-index
to when a project is created such that I can run make catalog-build
without opm index add
failing. The user has to build an index image containing one bundle first, and only then can they add --from-index
to the catalog-build
recipe one they're ready to add another bundle to the existing index. That's why I suggest we add a comment about this.
Signed-off-by: Eric Stroczynski <ericstroczynski@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on the rationale going with "a Makefile rule" vs "a subcommand".
Thanks for pointing that out!
Also left one comment regarding 'allowing users to add "a new bundle + its dependencies" to an existing catalog'.
Another thought:
Since "adding bundles/dependencies to an existing catalog" aspect is important for this epic, it might be great to also allow users to "remove packages/dependencies" from the catalog (also supporting "opm index prune"?) in case they need to edit/change the dependencies or simply need to revert a mistake.
What do you think?
catalog-build: opm | ||
$(OPM) index add --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we saying that the usecase for the sdk expects their users to keep historical record of all previous bundle images locally?
I don't think "keep a historical record of all previous bundle images locally" is a requirement. Hence, it's better to allow users to add a new bundle image (and potentially its dependencies from other Operators) to an existing catalog.
@tlwu2013 perhaps this would be useful to some devs, but I expect that number to be much smaller than those using |
Signed-off-by: Eric Stroczynski <ericstroczynski@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding examples for adding bundles + adding dependencies. Looks good to me!
This enhancement proposes an addition to
operator-sdk
-built projects that enables users to build catalogs in a straightforward, low-effort manner.Reference PR: operator-framework/operator-sdk#4406
Signed-off-by: Eric Stroczynski ericstroczynski@gmail.com