-
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
🐛 fix: webhook testEnv #4449
base: master
Are you sure you want to change the base?
🐛 fix: webhook testEnv #4449
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mateusoliveira43 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @mateusoliveira43. 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-sigs/prow repository. |
@camilamacedo86 will undo change to
Will add more info to PR description |
0c36daf
to
d540c85
Compare
docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
Outdated
Show resolved
Hide resolved
Can you rebase it with the master and ensure that you have what was changed and why in the description? |
Signed-off-by: Mateus Oliveira <[email protected]>
d540c85
to
f645d9b
Compare
@camilamacedo86 updated |
@@ -29,8 +29,7 @@ import ( | |||
. "github.com/onsi/ginkgo/v2" | |||
. "github.com/onsi/gomega" | |||
|
|||
admissionv1 "k8s.io/api/admission/v1" | |||
apimachineryruntime "k8s.io/apimachinery/pkg/runtime" | |||
"k8s.io/client-go/kubernetes/scheme" |
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.
Thanks for suggesting this! I’ve been thinking about it, and I believe we should stick to the current setup for a few reasons:
- It gives users granular control over adding only the API groups they need for their test cases, keeping things lightweight and precise. Not that it is not a bug. It is done in this one by design. Users can add ANY required scheme.
- Using
client-go/kubernetes/scheme
adds all API groups by default, which increases memory usage and makes debugging schema issues harder.
The current approach is more streamlined for custom resources, avoiding unnecessary complexity or conflicts.
/hold
Overall, I think the flexibility of the existing setup is better suited for varied test scenarios.
Let me know your thoughts!
Best,
Enable conversion webhooks for webhook
suite_test.go
envtest
by usingk8s.io/client-go/kubernetes/scheme
instead of creating new scheme (this also already done in controllersuite_test.go
)