-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: add PatchArgs API type to populate patch options #5930
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
base: master
Are you sure you want to change the base?
Conversation
Hi @adoramshoval. Thanks for your PR. I'm waiting for a kubernetes-sigs 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-sigs/prow repository. |
/ok-to-test |
This looks good! The nil handling for Since this changes a |
Hi @sarab97 , thanks for your review! |
Hi, I have stummbled upon an issue while trying to reimplement the The test expects: apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- patch: |-
- op: replace
path: /some/existing/path
value: new value
target:
kind: Deployment
labelSelector: env=dev but the actual output is: apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- options: {}
patch: |-
- op: replace
path: /some/existing/path
value: new value
target:
kind: Deployment
labelSelector: env=dev Notice the added @sarab97 , @koba1t , @stormqueen1990 |
Hi there, @adoramshoval! I did some testing with a simpler piece of code and noticed the same behaviour. Your assessment makes sense to me: a struct cannot have a zero value and therefore will be serialized into YAML/JSON even when not explicitly specified. @sarab97 would you agree to go back to the original implementation with a pointer so we can keep the serialization behaviour of kustomize? |
If its fine by you yeah sure, even though it adding option as empty it is not expected. So Im guessing the original approach is the only way. |
Then I'll proceed with this. |
d94d556
to
139877b
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: adoramshoval 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 |
This commit converts the Options section of a patch into an object instead of map. This allows better clarification of the available options.
139877b
to
9043c22
Compare
/retest |
I made the changes, I hope this won't fail lint tests now. |
This commit converts the Options section of a patch into an object instead of map.
This allows better clarification of the available options and should prevents human typing errors.
It is the base branch for an already existing branch adding the option
allowNoTargetMatch
, see #5917 .This was requested as part of #4715 , see https://github.com/kubernetes-sigs/kustomize/pull/4715/files#r1278209456.