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

Standardize config folders structure #3821

Open
mateusoliveira43 opened this issue Mar 24, 2024 · 4 comments
Open

Standardize config folders structure #3821

mateusoliveira43 opened this issue Mar 24, 2024 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/blocked
Milestone

Comments

@mateusoliveira43
Copy link
Contributor

What do you want to happen?

I think would be good to standardize the structure of folders generated under config folder. Example:

  • crd folder has bases folder
  • samples folder does not have bases folder

My motivation was an automation I added to a project, which was easier to add to folders that had bases folder

I believe the only change, would be that kustomization.yaml files would change resources section from - file_name to - bases/file_name

I also believe this problem is NOT A PRIORITY, just a nice to have feature

Extra Labels

No response

@mateusoliveira43 mateusoliveira43 added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 24, 2024
@camilamacedo86
Copy link
Member

camilamacedo86 commented Mar 29, 2024

Hi @mateusoliveira43

thank you for raising this one. Could you please let us know what scenario/when would be helpful we have the based in the samples? Or if you face any problem / limitation that motivates you raise this one. Thank you.

@mateusoliveira43
Copy link
Contributor Author

I was adding a controller generated by kubebuilder to an operator generated by operator sdk

so, I wanted to added needed files to the operator (CRDs, RBACs, image and samples) under its config/ folder. For CRDs, I just copied folders under crd/bases/ folder, for samples, I needed to add an if statement to not add kustomization.yaml file, only the CRD example files in samples/ folder.

I think for understanding kustomize, is also nice to have the struct of bases/ folder.

@camilamacedo86
Copy link
Member

Hi @mateusoliveira43

If we do this change then would we introduce a breaking change?
That means:

  • If we create a project with the CLI tool current version
  • Then, use a new version with this change to scaffold new APIs
  • Would that work or fail?

If that fail, then it can only be done within a new go layout version (go/v5). If that is the case, than we can link it to go/v5 milestone and when we have a lot of item that justify we have a go/v5 we can work on this one.
Otherwise, you mut ensure backwards compatibility in this implementation.

Cheers,

@mateusoliveira43
Copy link
Contributor Author

I did not test, but I think would work yes

basically, is just the kustomize resource path that would change, right?

Example: created project with current version and ran create api command. That will create following structure:

config/samples
├── kustomization.yaml
└── group_version_name1.yaml

Afterwards I update to idea version, and ran create api command again, then structure will look like this:

config/samples
├── bases
│   └── group_version_name2.yaml
├── kustomization.yaml
└── group_version_name1.yaml

With kustomization.yaml looking like this

## Append samples of your project ##
resources:
- group_version_name1.yaml
- bases/group_version_name2.yaml
#+kubebuilder:scaffold:manifestskustomizesamples

But it does look less organized, as some files are in config/samples/ and others are in config/samples/bases/, so being in go/v5 works for me 😄

@camilamacedo86 camilamacedo86 added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Mar 31, 2024
@camilamacedo86 camilamacedo86 added this to the go/v5 milestone Mar 31, 2024
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. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/blocked
Projects
None yet
Development

No branches or pull requests

2 participants