⚠️ Migration to the new events API#3262
Conversation
|
Hi @clebs. 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. DetailsInstructions 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. |
|
Open Items:
|
|
/ok-to-test |
6bfbd83 to
0528c33
Compare
|
/assign |
|
@clebs Just a heads up. If we want to get this into the next CR minor release the deadline is in 2-3 weeks. We want to release the next CR minor shortly after the Kubernetes minor which is scheduled for 27th August |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, clebs, sbueringer 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 |
…`v0.23.1`, `sigs.k8s.io/controller-tools` to `v0.20.0` (#13982) * `make tidy && make generate` * Solve `OpenTelemetry-Operator` dependency issue The `OpenTelemetry-Operator` includes dependencies to an older version of `sigs.k8s.io/controller-runtime` which is incompatible with the version (v0.23) used in Gardener. Copying the API packages solves the dependency conflict for now. See open-telemetry/opentelemetry-operator#4667 for more information. * Adapt to incompatible changes * Adapt `OpenAPI` generation The generation needs to be adapted due to kubernetes/kube-openapi#563 * Migrate to `k8s.io/client-go/tools/events` Motivated by kubernetes-sigs/controller-runtime#3262 * Refactor: Remove obsolete `rest.Config` constructor * Add `ReconciliationTimeout` panel Add `ReconciliationTimeout` panel to the controller details dashboard. The uses the newly introduced `controller_runtime_reconcile_timeouts_total metric` metric (see kubernetes-sigs/controller-runtime#3382). * Change `NodeAgentAuthorizer` integration test Don't use the event recorder to test patch permissions. We've seen cases where the event recorder drops events if they are recorded too quickly.
Upgrades controller-runtime from v0.22.4 to v0.23.3. The k8s.io/* packages were already at v0.35.0 and required no changes. The priority queue is now enabled by default (kubernetes-sigs/controller-runtime#3332), so the explicit UsePriorityQueue: new(true) in cmd/main.go is dropped. The webhook builder API changed to a generic form (kubernetes-sigs/controller-runtime#3360). NewWebhookManagedBy(mgr).For(&T{}) is replaced by NewWebhookManagedBy(mgr, &T{}). Validators are migrated from the deprecated CustomValidator interface with runtime.Object signatures to the typed Validator[T] interface with concrete types, removing the type assertion boilerplate. Test cases for wrong-object-type errors are removed as they are no longer expressible at runtime. The events API changed from k8s.io/client-go/tools/record to k8s.io/client-go/tools/events (kubernetes-sigs/controller-runtime#3262). GetEventRecorderFor is replaced by GetEventRecorder. All controllers and the provisioning server are updated accordingly, and call sites are updated to the new Eventf signature which adds related object and action fields. Tests use the new events.NewFakeRecorder.
The priority queue is now enabled by default (kubernetes-sigs/controller-runtime#3332), so the explicit UsePriorityQueue: new(true) in cmd/main.go is dropped. The webhook builder API changed to a generic form (kubernetes-sigs/controller-runtime#3360). NewWebhookManagedBy(mgr).For(&T{}) is replaced by NewWebhookManagedBy(mgr, &T{}). Validators are migrated from the deprecated CustomValidator interface with runtime.Object signatures to the typed Validator[T] interface with concrete types, removing the type assertion boilerplate. Test cases for wrong-object-type errors are removed as they are no longer expressible at runtime. The events API changed from k8s.io/client-go/tools/record to k8s.io/client-go/tools/events (kubernetes-sigs/controller-runtime#3262). GetEventRecorderFor is replaced by GetEventRecorder. All controllers and the provisioning server are updated accordingly, and call sites are updated to the new Eventf signature which adds related object and action fields. Tests use the new events.NewFakeRecorder.
The priority queue is now enabled by default (kubernetes-sigs/controller-runtime#3332), so the explicit UsePriorityQueue: new(true) in cmd/main.go is dropped. The webhook builder API changed to a generic form (kubernetes-sigs/controller-runtime#3360). NewWebhookManagedBy(mgr).For(&T{}) is replaced by NewWebhookManagedBy(mgr, &T{}). Validators are migrated from the deprecated CustomValidator interface with runtime.Object signatures to the typed Validator[T] interface with concrete types, removing the type assertion boilerplate. Test cases for wrong-object-type errors are removed as they are no longer expressible at runtime. The events API changed from k8s.io/client-go/tools/record to k8s.io/client-go/tools/events (kubernetes-sigs/controller-runtime#3262). GetEventRecorderFor is replaced by GetEventRecorder. All controllers and the provisioning server are updated accordingly, and call sites are updated to the new Eventf signature which adds related object and action fields. Tests use the new events.NewFakeRecorder.
This Pull Request migrates from the old events API (
k8s.io/client-go/tools/record) to the new API (k8s.io/client-go/tools/events).Closes #2141