-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Code struct for each kustomization field #4671
Comments
@annasong20: This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
A bit of context to get you started: We actually already have structs (albeit not with the name you'd expect) representing the types that power most of these fields, and I didn't mean to suggest that we should have additional ones for the fields themselves. For example, the This comes with a bunch of caveats though:
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Looking further at the code and discussions in #4797, I don't think this will be happening because
|
Status: This is a draft feature request. I will update it as I further my understanding of the codebase.
Is your feature request related to a problem? Please describe.
@KnVerey first suggested this change in #4590 (comment).
Essentially, every time kustomize looks for a specific behavior in its fields, each field requires its own processing code. For example, to find all files that a kustomization file references,
kustomize localize
would need code to look for referenced files within each field.This approach is chunky: it makes the code more difficult to read. It's prone to bugs because not only is the logic is hard to follow, but also when the behavior of fields change, developers need to re-evaluate all various occurrences of code that processes the field in this manner.
Describe the solution you'd like
The problem is that, currently, the logic must be centrally managed because each field is not its own struct. If each field has its own struct type, the struct can implement different interfaces for the different use cases that need to process the field. In this way, most logic around processing the field will be local to each field, and thus easier to manage.
Describe alternatives you've considered
I have not come up with any alternatives at the moment.
Additional context
Will add as I go.
The text was updated successfully, but these errors were encountered: