Skip to content
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

Split scaffold package #1264

Closed
Adirio opened this issue Dec 16, 2019 · 0 comments · Fixed by #1348
Closed

Split scaffold package #1264

Adirio opened this issue Dec 16, 2019 · 0 comments · Fixed by #1348
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Adirio
Copy link
Contributor

Adirio commented Dec 16, 2019

Feature

Split the scaffold package (pkg/scaffold) in two separate packages.

Motivation

The scaffold package has most of the code of this project and is getting pretty hard to deal with. Splitting it into two separate packages could make development and maintaining easier. It currently contains both the scaffolding machinery and the files that will be generated (there are currently 73 implementations of the File interface, plus additional files for tests and utils).

The proposed packages would split the scaffolding machinery from the files themselves. The name of the new package could be one of the following, depending on the external exposure needs:

1- pkg/files
2- internal/files
3- pkg/internal/files
4- pkg/scaffold/internal/files

IMHO, the files implementations doesn't need to be exported, so one of the internal options could be used. This way, the exported surface of kubebuilder would be reduced, making easier to make changes without breaking third-party tools that relied on these files. Reduced exported surface equals reduce exposed surface from a security perspective too.

From options 2-4, I think that the best fit is option 3. From a design perspective, exposing files to the command package doesn't seem a good choice, so I think that the 3rd and 4th options fit better than the 2nd. Option 3 does a better job in splitting scaffolding machinery and files, while the 4th still keeps a big scaffold package.

/kind feature

@Adirio Adirio added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant