-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Scaffold webhook test examples do not use suite_test structure #4442
Comments
To ensure that I understand, you are saying that instead of calling the method that set the default values
We should create the resource I think you are right about this one. |
Small nit, but to make assertions on the error of a function call, you should chain the Expect with Expect(k8sClient.Create(ctx, obj)).Error().NotTo(HaveOccurred()) Gomega also provides a shorthand for this specifically for the single- Expect(k8sClient.Create(ctx, obj)).To(Succeed()) |
@mateusoliveira43 I think we just need to address #4442 (comment) then we can close this one, right? |
need to add the code changes to the project |
|
we need to be able to create namespaces in webhook tests (to be able to create CRD). So adding namespace object to webhook tests scheme or using a fully loaded scheme #4449 |
What do you want to happen?
For example, Defaulter webhook was already setup here
kubebuilder/testdata/project-v4/internal/webhook/v1/webhook_suite_test.go
Line 121 in 944a9de
And manager started here
kubebuilder/testdata/project-v4/internal/webhook/v1/webhook_suite_test.go
Line 137 in 944a9de
But example tells user to manually call Defaulter webhook
kubebuilder/testdata/project-v4/internal/webhook/v1/admiral_webhook_test.go
Lines 49 to 58 in 944a9de
It could be simplified to
Extra Labels
/kind cleanup
The text was updated successfully, but these errors were encountered: