-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
🌱 Automatically update the multiversion tutorial #4138
🌱 Automatically update the multiversion tutorial #4138
Conversation
777586c
to
46d09a5
Compare
46d09a5
to
83a8e08
Compare
a6df6a8
to
0d4e111
Compare
0d4e111
to
f67ad87
Compare
@camilamacedo86 Thanks. Its look good to me. /lgtm |
@sarthaksarthak9: changing LGTM is restricted to collaborators In response to this:
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. |
// Example: | ||
// It("Should apply defaults when a required field is empty", func() { | ||
// By("simulating a scenario where defaults should be applied") | ||
// obj.SomeFieldWithDefault = "" |
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.
odd indentation here?
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.
Then we need to solve that in the scaffold see: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_test_template.go
We need another PR for that. I raised an issue: #4148
Good catcher btw !!!!
// By("simulating a scenario where defaults should be applied") | ||
// obj.SomeFieldWithDefault = "" | ||
// err := obj.Default(ctx) | ||
// Expect(err).NotTo(HaveOccurred()) |
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.
// Expect(err).NotTo(HaveOccurred()) | |
// Expect(obj.Default(ctx)).To(Succeed()) |
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.
Then we need to solve that in the scaffold see: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_test_template.go
We need another PR for that. I raised an issue: #4148
Good catcher btw !!!!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, mogsie 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 |
// It("Should deny creation if a required field is missing", func() { | ||
// By("simulating an invalid creation scenario") | ||
// obj.SomeRequiredField = "" | ||
// warnings, err := obj.ValidateCreate(ctx) |
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.
These three lines can be replaced with one:
// warnings, err := obj.ValidateCreate(ctx) | |
// Expect(obj.ValidateCreate(ctx)).Error().To(HaveOccurred()) |
This assertion includes the non-nil error check and the nil "warnings".
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.
Then we need to solve that in the scaffold see: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_test_template.go
We need another PR for that. I raised an issue: #4148
Good catcher btw !!!!
…nerate All our samples and documentation are automatically updated through the build process. However, the logic for handling multiversion samples was missing. This commit adds the necessary implementation to ensure multiversion samples are generated correctly using `make generate`. Co-Author: sarthaksarthak9 <sarthaknegi908@gmail.com>
f67ad87
to
c477981
Compare
Automatically update the multiversion tutorial
Fixes: #3880
Closes: #4103
Co-Author: sarthaksarthak9 sarthaknegi908@gmail.com