馃悰 envtest: get gvk from hook struct instead of forcing set TypeMeta by sbueringer 路 Pull Request #1665 路 kubernetes-sigs/controller-runtime (original) (raw)

timebertt added a commit to gardener/gardener that referenced this pull request

Oct 14, 2021

@timebertt

github.com/go-openapi/spec seems to be orphaned after previous make generate

Also, upgrade setup-envtest (doesn't have a tagged release yet, so use release commit instead)

Fix linting errors: Assertion redeclared in this block (typecheck)

ref kubernetes-sigs/controller-runtime#1626

ref kubernetes/kubernetes#99494

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.

ref kubernetes/kubernetes#102823

There were several changes in the fake clients that might cause the failure to happen just now.

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

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

webhookConfig.SetGroupVersionKind is not needed anymore with kubernetes-sigs/controller-runtime#1665

but with go 1.16.9