Add RBAC support for k8s_leader_elector extension (#4802)#4891
Open
gyanranjanpanda wants to merge 1 commit intoopen-telemetry:mainfrom
Open
Add RBAC support for k8s_leader_elector extension (#4802)#4891gyanranjanpanda wants to merge 1 commit intoopen-telemetry:mainfrom
gyanranjanpanda wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
|
|
9e1a54e to
535f216
Compare
swiatekm
reviewed
Mar 24, 2026
f52e31e to
de7d719
Compare
Contributor
E2E Test Results 32 files 249 suites 2h 6m 41s ⏱️ Results for commit 14d499b. ♻️ This comment has been updated with latest results. |
swiatekm
reviewed
Mar 27, 2026
| defaultPort int32 | ||
| }{ | ||
| {"health_check", "__health_check", 13133}, | ||
| {"k8s_leader_elector", "__k8s_leader_elector", 0}, |
Contributor
There was a problem hiding this comment.
I don't think you want this here, since it causes a bunch of port and config tests to be run (and fail). I'd just remove it, the other tests are sufficient.
Contributor
|
It looks like your E2E tests are failing as well @gyanranjanpanda. |
de7d719 to
199469c
Compare
199469c to
14d499b
Compare
Author
|
could @swiatekm check it now |
swiatekm
approved these changes
Mar 27, 2026
Contributor
swiatekm
left a comment
There was a problem hiding this comment.
LGTM, thank you for the contribution!
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.
Changes Made
This PR adds automatic RBAC generation support for the
k8s_leader_electorextension, addressing issue #4802.internal/controllers/opentelemetrycollector_controller.go: Updated operator Kubebuilder markers to requestget, list, watch, create, update, patch, deleteoncoordination.k8s.ioleases.internal/components/extensions/helpers.go: Registered thek8s_leader_electorextension to be detected during parsing.internal/components/extensions/k8sleaderelector.go: Added the RBAC policy generator giving the OpenTelemetryCollector service account permissions to participate in leader election vialeases..chloggen/issue_4802.yaml: Added the changelog entry.What Was Tested
ClusterRoleconstruction ininternal/manifests/collector/rbac_test.goand logic checking the presence of all 7 required verbs.chainsaw-test.yamlend-to-end framework test cases for thek8s_leader_elector.Validation Results
ClusterRolewhenever the collector configuration explicitly defines thek8s_leader_electorextension. E2E pipeline and unit tests have verified this automatically.