Skip to content
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

Vendor k/*@v0.22 and controller-runtime@v0.10 #4825

Merged
merged 21 commits into from
Oct 14, 2021

Conversation

timebertt
Copy link
Member

@timebertt timebertt commented Oct 12, 2021

How to categorize this PR?

/area open-source
/kind task

What this PR does / why we need it:

Vendors k8s.io/*@v0.22.2, sigs.k8s.io/controller-runtime@v0.10.2 and sigs.k8s.io/controller-tools@v0.7.0 and adapts to the breaking / most notable changes (see #4772).

Which issue(s) this PR fixes:

Main part of #4772, a few optional follow-ups will be done in dedicated PRs to keep this one limited to the minimum scope.

Special notes for your reviewer:

To ease the review, changes are split into dedicated commits, each targeting "one step" / "one adaption" to an upstream change.
Commits marked with [automated] are results of some make commands as denoted in the commit message, but no other manual changes (skip these commits in the review).
/squash

Release note:

The following golang dependencies have been upgraded, please consult the upstream release notes and [this issue](https://github.com/gardener/gardener/issues/4772) for guidance on upgrading your golang dependencies when vendoring this gardener version:
- `k8s.io/*` to `v0.22.2`
- `sigs.k8s.io/controller-runtime` to `v0.10.2`
- `sigs.k8s.io/controller-tools` to `v0.7.0`

@gardener-robot gardener-robot added area/open-source Open Source (community, enablement, contributions, conferences, CNCF, etc.) related kind/task General task merge/squash size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 12, 2021
@timebertt
Copy link
Member Author

check-generate was failing because I already upgraded to go1.17 on my machine (see #4822):

>> make generate
make generate needs to be run:
 M landscaper/pkg/controlplane/apis/imports/v1alpha1/zz_generated.conversion.go
 M landscaper/pkg/controlplane/apis/imports/v1alpha1/zz_generated.deepcopy.go
 M landscaper/pkg/controlplane/apis/imports/v1alpha1/zz_generated.defaults.go
...

Added another commit running make generate with go1.16.

Another reason for #4519.

@timebertt
Copy link
Member Author

timebertt commented Oct 12, 2021

I successfully validated the following:

  • create shoot
  • delete shoot
  • hibernate shoot
  • wake up shoot
  • delete hibernated shoot
  • migrate shoot
  • delete migrated shoot

Hence, this PR is ready for review 🚀
/ready

@gardener-robot gardener-robot marked this pull request as ready for review October 12, 2021 13:45
@gardener-robot gardener-robot requested review from a team as code owners October 12, 2021 13:45
@timebertt timebertt mentioned this pull request Oct 13, 2021
2 tasks
@rfranzke
Copy link
Member

/assign

@rfranzke
Copy link
Member

/rebase

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.
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
@timebertt
Copy link
Member Author

Done.
/remove needs/rebase

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very well done, thanks!

pkg/operation/botanist/clusteridentity_test.go Outdated Show resolved Hide resolved
pkg/operation/botanist/clusteridentity_test.go Outdated Show resolved Hide resolved
@timebertt
Copy link
Member Author

@rfranzke thanks a lot for your review. I addressed your suggestions, PTAL :)

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@timebertt timebertt merged commit 8abb827 into gardener:master Oct 14, 2021
@timebertt timebertt deleted the vendor/kk-cr branch October 14, 2021 12:03
krgostev pushed a commit to krgostev/gardener that referenced this pull request Apr 21, 2022
* 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
krgostev pushed a commit to krgostev/gardener that referenced this pull request Jul 5, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/open-source Open Source (community, enablement, contributions, conferences, CNCF, etc.) related kind/task General task size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants