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

kustomize edit add generator #4343

Closed
lack opened this issue Dec 16, 2021 · 4 comments · Fixed by #4361
Closed

kustomize edit add generator #4343

lack opened this issue Dec 16, 2021 · 4 comments · Fixed by #4361
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@lack
Copy link
Contributor

lack commented Dec 16, 2021

Is your feature request related to a problem? Please describe.

When I have a large number of generators in a directory, it is cumbersome to add them all to kustomization.yaml by hand.

Describe the solution you'd like

Just like is already available for transformers, I would like the "kustomize edit add" command to support adding generators by wildcard.

Probably "kustomize edit remove generator" should be added too for consistency.

Describe alternatives you've considered

Writing my own script that does this.

@lack lack added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 16, 2021
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 16, 2021
@natasha41575
Copy link
Contributor

natasha41575 commented Dec 20, 2021

Are you envisioning something similar to kustomize edit add resource? As in, if I do kustomize edit add generator gener.yaml, my kustomization.yaml file will be updated to contain the following:

generators:
- gener.yaml

If my understanding of the feature request is correct, I don't have any objections to this command being added to kustomize as a feature, especially since we already have a kustomize edit add transformer command that does exactly the same thing with the transformers field.

I would be happy to review and potentially accept a PR that implements this. If anyone is interested, you can look at the code in kustomize/commands/edit/add/addtransformer.go and copy most of the implementation from there - just change Transformers to Generators.

/triage accepted
/kind feature
/label help wanted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 20, 2021
@natasha41575 natasha41575 added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Dec 20, 2021
@lack
Copy link
Contributor Author

lack commented Dec 21, 2021

Are you envisioning something similar to kustomize edit add resource? As in, if I do kustomize edit add generator gener.yaml, my kustomization.yaml file will be updated to contain the following:

generators:
- gener.yaml

Exactly what I meant :)

If my understanding of the feature request is correct, I don't have any objections to this command being added to kustomize as a feature, especially since we already have a kustomize edit add transformer field that does exactly the same thing with the transformers field.

I would be happy to review and potentially accept a PR that implements this. If anyone is interested, you can look at the code in kustomize/commands/edit/add/addtransformer.go and copy most of the implementation from there - just change Transformers to Generators.

Thanks! I may give it a shot myself, time permitting...

@natasha41575
Copy link
Contributor

I have created the PR for this feature here #4361

@natasha41575 natasha41575 removed help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Dec 31, 2021
@natasha41575 natasha41575 self-assigned this Dec 31, 2021
@jgato
Copy link

jgato commented Nov 11, 2022

was this finally included? it seems an interesting feature, why we cannot add other resources but no generators with the edit add?

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. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants