kubebuilder: [Discussion] V3 breaking changes
Now that we are working on v3, it may be time to go ahead and do some of this changes that we can’t do on an stable version (such as v2). This issue is meant to be a discussion to see which of them shows enough interest by the developers/community in order to implement them.
- Split CRD and controller scaffolding into two different subcommands. In
v1andv2,kubebuilder create apicrteates both the CRD and the controller. Do we still think this is the desired behavior? Should we have a separate subcommand for the controller and eliminate the--resourceand--controllerflags? Should these two subcommands replace the current one or should we have three (create resourcefor the resource only,create controllerfor the controller only,create apifor both of them)? - Add external resource flag to controller creating subcommand. When this flag is passed, kubebuilder won’t search for the corresponding resource and will also take it into account at the tests, and when it is not passed the controller will validate that the appropiate resource is created, either by this same call, by a previous call, or even by hand.
If you think there are other related topics we should discuss, comment and I will add them here.
/cc @droot @DirectXMan12 @mengqiy @pwittrock @camilamacedo86 @estroz @joelanford
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (15 by maintainers)
Shows that we could create an EP for the add api option. WDYT?
create apicommand as-is, except invert flag defaults totrue.api/<version>orapis/<group>/<version>. I like @camilamacedo86’s idea of supplying a module/import path, perhaps with a more descriptive flag like--external-import.kubebuilder create apishouldn’t be doing anygo getstuff though; that’ll be done by calling make targets. The input would also have to describe the exact import path, and--groupwould have to be the full API group: We might also want to add the resource toresourcesin the config with anexternal: <boolean>qualifier.IMO:
Over split the command create api
So, shows for me that we might be prevailing keep it ease to maintaining instead of user experience. In this way, I am afraid that I am more inclined to vote against since I think the UX is more important here.
Over new flag to work with external types
I totally agree that we need to address this scenario. WDYT about we raise a new specific issue for this RFE? Also, instead of not scaffold the files I think we ought to educate and facilitate to the users how to work with for the external type which could be something such as we have a new plugin for that since we will not create an api but we will add one preexistent into the project.
Example:
kubebuiler add api --module=github.com/openshift/api --kind=route --version=v1go get -u go get -u github.com/openshift/api// run go get -u {{module}}