-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
🐛 Generate deterministic ordering for webhook manifests #779
Conversation
Signed-off-by: terasihma <tomoya-terashima@cybozu.co.jp>
Signed-off-by: terasihma <tomoya-terashima@cybozu.co.jp>
Welcome @terassyi! |
Hi @terassyi. 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. |
Expect(yaml.UnmarshalStrict(expectedFile, expectedManifest)).To(Succeed()) | ||
|
||
By("comparing the manifest") | ||
assertSame(actualManifest, expectedManifest) |
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.
How often does this fail without your code change? Do we need to run this test say 5 or 10 times to have any confidence in this fix?
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 get differently ordered manifests every time because of converting from map.
Do we need to run this test say 5 or 10 times to have any confidence in this fix?
Yes, I agree we should run it enough times.
Signed-off-by: terasihma <tomoya-terashima@cybozu.co.jp>
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.
/ok-to-test
No further feedback from me right now, lets check the tests
@@ -175,6 +175,55 @@ var _ = Describe("Webhook Generation From Parsing to CustomResourceDefinition", | |||
assertSame(actualMutating, expectedMutating) | |||
assertSame(actualValidating, expectedValidating) | |||
}) | |||
|
|||
It("should generate the ordered webhook definitions", func() { |
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.
Shame we aren't using ginkgo V2 as you could use MustPassRepeatedly(10)
if we were, maybe a future improvement
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.
It seems fine for me either.
I would say that is more like ✨ then a bug fix.
However, it is a nit.
/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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, terassyi, vincepri 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 |
What
This PR modified to generate webhook manifests sorted by name and added tests.
Why
Now we get differently ordered manifests every time.
It isn't easy to compare generated manifests.
Please see #730 for more information.