-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Umbrella issue] Scaffolding enhancements #1218
Comments
awesome! thanks for working on this :-) |
So, these are the names that exist according to CRDs:
So, we should have an internal representation of each of those. Without digging further, it's not clear what the different between |
Right now,
The plan is splitting these different parts into separate packages or at least subpackages.
The resulting structure would be:
@DirectXMan12 @mengqiy I would apreciate some feedback on this topic. Also, #1255, #1313 and #1325 need some love as they are blocking further progress in the scaffolding enhancement. |
I made a internal package dependency schema:
I think this schema makes a lot of sense. In order to achieve this, the three packages mentioned above still have to be moved into the "modelling" category.
After #1255 gets merged, the schema would look like: |
@DirectXMan12 with regard to pluralization, I agree on "weird pluralization rules." For instance, "Repo" would be another example. Currently that will pluralize as "Repoes." Apart from these examples, the pluralization is currently based on English rules. It is certainly conceivable that users will have resource types that are not English words. I have taken a look, and this particular change will percolate through both kubebuilder and controller-gen. |
There are probably some other enhancements that can be done but the main scaffold refactoring has already been merged. |
Description
The following issue will group together all the different enhancements aimed to obtain a smoother file scaffolding system that improves redability, removes duplicate sections, avoids calling several methods multiple times, and centralizes functionality.
Some of the enhancements will be straight forward and will be directly implemented by a PR while others will have their own issue in order to contain the discussion. Please, keep comments in this issue just related to general topics related this issue or suggestions on which other enhancements to apply and use the respective issues or PR to talk about each of the enhancements.
Motivation
The main scheme followed by kubebuilder is the following:
Issues found
cmd/webhook_1.go
orcmd/webhook_2.go
as examples).ProjectPath
is not required for any file and is provided to all, inpkg/scaffold/v1/crd/doc.go
a field calledComments
is not used, ...), information about the resource is kept outside the resource (GroupDomain
,ResourcePackage
), or stored in two places (Resource.Resource
vsPlural
).kubebuilder create api ...
command the resource is validated 13 times.Proposed solutions:
pkg/scaffold
and not incmd
.Resource
struct to contain the fields that are outside:GroupDomain
,Plural
andResourcePackage
.Resource.Resource
and(Resource.)Plural
are needed or keep only one of them.Related Issues and Pull Requests
Issues:
Pull requests:
More coming soon
/kind feature
The text was updated successfully, but these errors were encountered: