Skip to content
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 kustomize syntax during conversion to patches #3456

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

mjlshen
Copy link
Contributor

@mjlshen mjlshen commented Jun 14, 2023

This commit fixes the syntax error introduced in #3374 where pathcesStrategicMerge was replaced with patches, which now requires that every patch additionally have a "path" key when multiple patches are specified in a file.

Fixes #3425

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 14, 2023
@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 14, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @mjlshen. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

Copy link
Contributor

@lauchokyip lauchokyip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot
Copy link
Contributor

@lauchokyip: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

camilamacedo86
camilamacedo86 previously approved these changes Jun 14, 2023
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is great thank you for add this fix.

Would be amazing if we could get it in the e2e tests.
See that we generate a project with webhooks and uncommenting all options here: https://github.com/kubernetes-sigs/kubebuilder/blob/master/test/e2e/v4/generate_test.go we have an e2e test using webhooks.

I think it is missing we add here: https://github.com/kubernetes-sigs/kubebuilder/blob/master/test/e2e/v4/plugin_cluster_test.go#L106-L108 a line to call make manifests and make generate and see if it does not finish with error.

WDYT? If you be enable to add in this PR could you please give a hand for we have the tests in place in a follow up? Or for we have tracked an issue to do so at least?

/Otherwise

All shows fine for me.

/approved
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 14, 2023
@camilamacedo86 camilamacedo86 dismissed their stale review June 14, 2023 05:48

required to fix the testdata issue first. If possible would be great we also have the check in the e2e in place to avoid this scenario in the future.

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 14, 2023
@mjlshen
Copy link
Contributor Author

mjlshen commented Jun 14, 2023

A test for this definitely makes sense, I'll get the test in this PR as well, thanks for the feedback and pointers!

@mjlshen mjlshen force-pushed the 3374 branch 2 times, most recently from 2ca1179 to 38234b3 Compare June 14, 2023 20:24
@mjlshen
Copy link
Contributor Author

mjlshen commented Jun 14, 2023

I believe I have now also added a relevant test to guard against bugs like these in the future!

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 15, 2023
@rbroggi
Copy link

rbroggi commented Jun 17, 2023

Nice, I also faced this issue yesterday!

@camilamacedo86 : Should we create a ticket to followup this change with the proper updates in the kubebuilder book?

What is the adopted practice on the book updates (since it is not versioned along with kubebuilder)?

@mjlshen
Copy link
Contributor Author

mjlshen commented Jun 17, 2023

The book updates should be in this PR too (the changes underneath docs/), unless you are referring to something else - but the process is described here: https://github.com/kubernetes-sigs/kubebuilder/blob/master/CONTRIBUTING.md#how-to-contribute-to-docs

@camilamacedo86
Copy link
Member

HI @mjlshen,

Could you please rebase this one with the master branch to get the CI fixes?
Also, please ensure that we have only 1 commit for we are able to move forward with this one.

By last would be amazing if we could add the e2e tests in this one

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2023
@camilamacedo86 camilamacedo86 added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-blocker labels Jun 20, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2023
@mjlshen mjlshen force-pushed the 3374 branch 2 times, most recently from 4aa2294 to 66933fe Compare June 20, 2023 12:16
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 20, 2023
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unable to reproduce the issue scenario, see: #3425 (comment)
Also, by looking at the kustomize docs the current code implementation shows right: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/#patch-using-inline-strategic-merge

By last, since I am unable to reproduce, we test this config in the e2e tests where we ensure that all works fine and by looking in the issue seems that the problem is that not all values that should be uncommented were not then, I do not think that we should move with this one.

So, /hold

Let's discuss this scenario in the issue.
Thank you a lot for your collaboration.

@camilamacedo86 camilamacedo86 added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-blocker labels Jun 20, 2023
@camilamacedo86 camilamacedo86 self-requested a review June 21, 2023 05:25
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi mjlshen,

Can we add here the e2e test changes as well so that we can ensure that the same error is no longer faced with the changes performed?

@mjlshen
Copy link
Contributor Author

mjlshen commented Jun 21, 2023

I've moved the e2e test fixes into this PR - thank you a lot for your collaboration as well, working on this PR has been a great experience!

This commit fixes the syntax error introduced in kubernetes-sigs#3374 where
pathcesStrategicMerge was replaced with patches, which now requires that
every patch additionally have a "path" key when multiple patches are
specified in a file.

Signed-off-by: Michael Shen <mishen@umich.edu>
@camilamacedo86
Copy link
Member

/test pull-kubebuilder-e2e-k8s-1-26-0

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold cancel

It has a test either to show that it fixes the issue

/approved
/lgtm

Thank you a lot for your contribution 🥇

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 21, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, lauchokyip, mjlshen

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2023
@k8s-ci-robot k8s-ci-robot merged commit 47e6cab into kubernetes-sigs:master Jun 21, 2023
17 checks passed
@mjlshen mjlshen deleted the 3374 branch June 21, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid Kustomize generation
5 participants