-
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
Fix nil pointer dereferencing when converting vars
to replacements
#5211
Conversation
Welcome @Aceralon! |
Hi @Aceralon. 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/test-infra repository. |
vars
to replacements
vars
to replacements
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.
Thanks for your contribution, we do not have any test cases covering this function ConvertVarsToReplacements
, nor writePatchTargets
. To make us more confident to merge this PR, would you mind add a test case for this PR into convert_test.go?
/assign |
This PR has multiple commits, and the default merge method is: merge. 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. |
Added the test case. |
5c8587f
to
1d49a72
Compare
Thank you. |
cc @koba1t may you please look at this one? And we need to trigger the CI process. |
@Aisuko |
Got it, thank you. |
Rebased to the latest master. |
I see that there are some new issues raised relate to this bug: cc @annasong20 @natasha41575 can you kindly look at this pr. Thank you. |
/ok-to-test @Aceralon Apologies, could you rebase again to trigger the test suite? |
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.
Couple of very small comments. Overall LGTM
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.
accidentally approved instead of requesting changes, whoops
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.
Mostly LGTM, but the tests seem to have a small typo.
@natasha41575 Finished all the changes. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Aceralon, natasha41575 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks for the contribution! Please feel free to take a look at our project boards if you are looking for more issues to contribute to. |
/lgtm Sorry, missed adding the lgtm tag with my approval |
Fix
patch.Target
is nil inwritePatchTargets
kustomize/kustomize/commands/edit/fix/convert.go
Lines 284 to 287 in 9e42f8d
When converting a kustomization file that contains
Patch
with onlyPath
field, using--vars
might cause kustomize to panic for dereferencing nil pointer.Example for the bug:
Then run
kustomise edit fix --vars
under this folder.