-
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
Kustomize FieldSpec skip #1232
Kustomize FieldSpec skip #1232
Conversation
Hi @jbrette. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jbrette The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @monopole @Liujingfang1 |
Could you please clarify a bit the precedence of the configurations? @jbrette
What is the expected behavior?
|
d4057bf
to
88c4520
Compare
reviewers: | ||
- "@monopole" | ||
- "@Liujingfang1" | ||
approvers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add monopole
in the approver list?
create: false | ||
group: apps | ||
kind: Deployment | ||
behavior: remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think skip: true
can do the same thing.
type FieldSpecConfig struct { | ||
FieldSpec `json:",inline,omitempty" yaml:",inline,omitempty"` | ||
// Behavior legal values are "", "add", "replace", "remove" | ||
Behavior string `json:"behavior,omitempty" yaml:"behavior,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you need this. The skip
field from 1 can already overwrite the default behavior.
type FieldSpec struct { | ||
gvk.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"` | ||
Path string `json:"path,omitempty" yaml:"path,omitempty"` | ||
CreateIfNotPresent bool `json:"create,omitempty" yaml:"create,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the relationship between CreateIfNotPresent
and SkipTransformation
? Which one has higher priority?
|
||
### Non-Goals | ||
|
||
- Provide backward compatibility with the transformer default configurations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep backward compatibility otherwise who customize the builtin transformer configuration will experience breaking changes.
Keep backward compatibility should be listed as a Goal
Not a fan of adding a skip field to FieldSpec. First, the purpose of the type FieldSpec is to specify a field (not a transformation), and is used in other places besides transformer configs. Adding a 'skip' bit there to describe how a transformation should behave is hacky. Having Second, we can already 'skip' Kinds with no code change, by invoking a Third, we need to think carefully about the new plugin architecture and how changes to kustomization.yaml influence it. The kustomization file is now a means to launch plugins, and in the new world those plugins are in control of their own config. There's an adaptive layer to map old fields (e.g. namePrefix) to plugins, but that's all it is - an adaptive layer to shove config from the old world to the new. It's possible that kustomization fields (other than |
Have you considered using a plugin to modify another plugin config as a way to build up either an inclusion or exclusion list? |
Projects like kubeadm and kubeflow seems to end up having to write go code to create those kustomization.yaml, basically transforming the kustomization.yaml before invoking kustomize on the actual resources.
None of them were actual simple to use (especially dealing with the ingress object).
All those thing render the kustomization.yaml and folders really much harder to build. I think that we could probably have a real balance between ease of use and flexibility provided by the plugins if
|
thanks, well considered. lots to unpack here.
|
.so issues; I added a bug because kustomize neither 3.1.0 nor master does seems to be able to locate the builtin module here Let's hope this is just a question of documenting what to set in the environment. |
In order to be able compare the pros and cons of a the solution, I updated the "canary/production" deployment environment:
All those three examples are building the same output, and pass mdrip --mode=test README.md |
Regarding the "transfomers:" solution, [lease tell me what is missing, but using the tranformers method seems to currently constraint the user to copy paste the transformer configuration. Unlike the "configurations:" entry which is only accumulating fieldspec accross kustomize contexts and allow reuses, the yaml for instance of the prefixsuffix transformer contains the "suffix" value and the "field spec list". To be able to use two suffices in two different context, you end up have to copy paste the fieldspec. Added the following issue Will add additional tests to address that point. |
88c4520
to
df1a4ab
Compare
not enough time to dedicate this KEP. |
No description provided.