Repository navigation
Grant leader election core events access - #7349
Merged
ChrisJBurns merged 1 commit intoNov 27, 2026
Merged
ChrisJBurns merged 1 commit into
ChrisJBurns merged 1 commit into
Conversation
The leader-election lock records events through the core API group, but the leader-election Role only allowed events in events.k8s.io. When the operator namespace is not in rbac.allowedNamespaces, writing the LeaderElection event is forbidden. Fixes stacklok#7299 Signed-off-by: Alex <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7349 +/- ##
==========================================
- Coverage 82.57% 82.56% -0.01%
==========================================
Files 940 940
Lines 96639 96639
==========================================
- Hits 79799 79790 -9
- Misses 16835 16844 +9
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ChrisJBurns
approved these changes
Nov 27, 2026
1 task
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.
Fixes #7299
Summary
GetEventRecorderFor), which writeseventsin the core API group. The leader-election Role only allowseventsinevents.k8s.io, so withrbac.scope=namespaceand an operator namespace outsideallowedNamespaces, winning the election logsevents is forbidden.eventscreate/patchrule tooperator.leaderElectionRole.rules. Theevents.k8s.iorule stays. The chart README is regenerated withhelm-docs.Type of change
Test plan
task test)task test-e2e)task lint-fix)Ran
helm unittest deploy/charts/operator: the new test fails without thevalues.yamlchange (85 passed, 1 failed) and all 86 tests pass with it. This renders the chart only; it was not run against a cluster.Does this introduce a user-facing change?
The operator can now record its leader-election event in namespace-scoped installs. Installs that override
operator.leaderElectionRole.rulesneed to add the rule themselves.This change was prepared with AI assistance.