-
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 name suffix not being applied when "patchesJson6902" is used #4266
Fix name suffix not being applied when "patchesJson6902" is used #4266
Conversation
Welcome @Serializator! |
Hi @Serializator. 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. |
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.
This PR needs a regression test, I suggest adding it to api/krusty/multipatch_test.go
. You can look at the other tests in api/krusty
for examples.
First commit should introduce the test with the wrong output demonstrating the failing behavior. Second commit should provide the fix, and correct the output in the test.
@@ -48,13 +48,13 @@ func (kt *KustTarget) configureBuiltinTransformers( | |||
tc *builtinconfig.TransformerConfig) ( | |||
result []resmap.Transformer, err error) { | |||
for _, bpt := range []builtinhelpers.BuiltinPluginType{ | |||
builtinhelpers.PatchJson6902Transformer, | |||
builtinhelpers.PatchStrategicMergeTransformer, | |||
builtinhelpers.PatchTransformer, | |||
builtinhelpers.NamespaceTransformer, |
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.
While I agree that the patchJson6902Transformer
should be placed next to the other patch transformers for consistency in behavior, I'm wondering if there might be any other unintended or possibly undesirable consequences for changing the order?
Excuse me, I completely neglected to run the tests locally, that would've made me aware of the regression before creating a pull request. I will check what and why it broke. Using bisect I also pinpointed the commit in which it was broken (bd4580d), I will use that as reference point. It obviously isn't the order which broke it as this hasn't really changed since +/- 2019. I was too focused on the code rather than take the history into consideration. I will add the regression test once I pinpointed the root cause. Thank you for the feedback! |
I will communicate further status updates through the original issue (#4111). This way the scope of the conversation in the pull request is kept to the concrete implementation of the final solution rather than findings along the way. |
5a23361
to
bb7f7ec
Compare
I pushed the proper solution I came up with after finding out this was caused by build annotations not being preserved after a JSON 6902 patch is applied. I will a add the proper regression tests this evening or tomorrow. @natasha41575, are files in |
There is a command you can run, looking at the Makefile it might be /ok-to-test |
bb7f7ec
to
d70bc84
Compare
@Serializator: 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. |
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.
LGTM apart from this extremely minor formatting nit. Thank you!
@@ -6,6 +6,7 @@ package main | |||
|
|||
import ( | |||
"fmt" | |||
"sigs.k8s.io/kustomize/kyaml/kio/kioutil" |
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.
nit: Move this to line 17 with the other sigs.k8s.io
imports (and please make sure they are in alphabetical order)
@@ -6,6 +6,7 @@ package main | |||
|
|||
import ( | |||
"fmt" | |||
"sigs.k8s.io/kustomize/kyaml/kio/kioutil" |
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.
same comment here
Also please take a look at the CI errors, it looks like there are some go-gets you have to run. |
@natasha41575, running |
d70bc84
to
cff4b66
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: natasha41575, Serializator 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 |
/retest |
/test all |
I don't understand why it is failing out of the sudden... @natasha41575, is it maybe because I didn't commit the |
Yes, please commit all your local changes, including all changes in |
cff4b66
to
b6cb6c8
Compare
@natasha41575 I made the last changes and should pass all tests now. Sorry for the many back and forwards, still learning the workflow and how everything works / is structured within Kustomize 😄 |
/lgtm Thanks for working on this! |
Fixes #4111