🐛 envtest: get gvk from hook struct instead of forcing set TypeMeta#1665
Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom Sep 16, 2021
Merged
Conversation
Member
Author
|
/assign @vincepri |
Signed-off-by: Stefan Büringer buringerst@vmware.com
43c6eaa to
3929c84
Compare
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer, vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
6 tasks
timebertt
added a commit
to timebertt/gardener
that referenced
this pull request
Oct 14, 2021
webhookConfig.SetGroupVersionKind is not needed anymore with kubernetes-sigs/controller-runtime#1665
timebertt
added a commit
to gardener/gardener
that referenced
this pull request
Oct 14, 2021
* Upgrade to k8s.io/*@v0.22.2 in go.mod
* [automated] make revendor
* [automated] make generate
* [automated] make revendor
github.com/go-openapi/spec seems to be orphaned after previous make generate
* Upgrade to c-r@v0.10.2 in go.mod
Also, upgrade setup-envtest (doesn't have a tagged release yet, so use
release commit instead)
* [automated] make revendor
* Upgrade to controller-tools@v0.7.0 in go.mod
* [automated] make revendor
* Add missing WarningsOn{Create,Update} to rest strategies
* Replace dot imports for github.com/onsi/gomega/types
Fix linting errors: `Assertion` redeclared in this block (typecheck)
* Switch to typed values for WebhookInstallOptions.*Webhooks
ref kubernetes-sigs/controller-runtime#1626
* RequestCertificate now takes an optional requestedDuration
ref kubernetes/kubernetes#99494
* Switch to matchers.DeepEqual to test semantic equality
Maps (e.g. labels, selectors, resource requirements) might be sorted differently
than expected. Hence, use semantic equality instead of strict equality, as this
is what matters to us.
Also, DeepEqual outputs yaml and adds a nice diff indicator instead of printing
some large confusing go struct representation.
* Add new memorySwap field to expected kubelet config
ref kubernetes/kubernetes#102823
* Round condition.lastUpdateTime to seconds in test
There were several changes in the fake clients that might cause the failure
to happen just now.
* Correct unit tests falsely succeeding
These tests were not preparing the test objects correctly: they only updated
them in memory but not on the fake client. This wasn't caught until now
because the fake client mimicked the real json decoder, which didn't unset
fields not present on the server. Now that the fake client zeroes fields,
the tests started failing (which is correct). So fix the tests.
ref kubernetes-sigs/controller-runtime#1651
* Remove workarounds for missing zeroing in json decoder
Now that the c-r client zeroes fields before decoding into the object,
we can drop our workarounds for this, so basically drop
kutil.CreateResetObjectFunc and its usages.
ref kubernetes-sigs/controller-runtime#1640
* Drop setting webhook gvk explicitly in envtest
webhookConfig.SetGroupVersionKind is not needed anymore with
kubernetes-sigs/controller-runtime#1665
* Add some follow-up TODO comments
* [automated] make generate
but with go 1.16.9
* Address review comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Stefan Büringer buringerst@vmware.com
Without this fix it's necessary to set TypeMeta in ValidatingWebhookConfiguration and MutatingWebhookConfiguration, e.g. like this:
With this fix we will just get the type from the "struct".
xref: https://github.com/kubernetes-sigs/cluster-api/pull/5249/files#r709959229