-
Notifications
You must be signed in to change notification settings - Fork 103
Switch controller events to events.k8s.io/v1 #1119
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for kubernetes-sigs-jobset canceled.
|
|
Welcome @erain! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: erain The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @erain. 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. |
|
/ok-to-test |
|
/retest I'm rerunning the tests, but I suspect this is not a flake. |
|
Trying out copilot reviews right now. |
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.
Pull request overview
This PR migrates controller event emission from the legacy core/v1 events API to the newer events.k8s.io/v1 API using client-go's events broadcaster. The migration ensures fail-fast behavior if the v1 events API is unavailable, while keeping leader-election events unchanged.
Changes:
- Replaced
record.EventRecorderwithevents.EventRecorderacross all controllers - Added startup validation for
events.k8s.io/v1API availability with proper error handling - Updated RBAC permissions from core events to
events.k8s.iogroup in both kustomize and Helm configurations - Updated integration and unit tests to assert v1 event structure (
regarding,Series.Count) and use v1 fake recorders - Added benchmark for v1 event recording performance
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Implements newEventBroadcaster with API availability check; wires v1 event recorders to controllers |
| pkg/controllers/jobset_controller.go | Updates event recorder type and Eventf calls to 6-parameter v1 signature; updates RBAC annotation |
| pkg/controllers/pod_controller.go | Updates event recorder type and RBAC annotation |
| pkg/controllers/volume_claim_policy.go | Updates Eventf call to 6-parameter v1 signature |
| pkg/controllers/*_test.go | Replaces old event broadcaster/recorder with events.NewFakeRecorder |
| test/integration/controller/suite_test.go | Sets up v1 event broadcaster with proper initialization and shutdown |
| test/integration/controller/jobset_controller_test.go | Updates event assertions to use v1 fields (regarding, Series.Count) |
| pkg/controllers/events_benchmark_test.go | Adds benchmark for v1 event recording with custom sink implementation |
| config/components/rbac/role.yaml | Replaces core events RBAC with events.k8s.io group permissions |
| charts/jobset/templates/controller/cluster_role.yaml | Updates Helm RBAC to use events.k8s.io API group |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
events.k8s.io/v1using the client-go events broadcaster.Which issue(s) this PR fixes:
Fixes # (n/a)
Special notes for your reviewer:
events.EventRecorder.Performance results:
Does this PR introduce a user-facing change?