[Core] Add owner reference to RBAC resources for automatic cleanup#492
Merged
Conversation
Signed-off-by: bcfre <guo0xiong1feng@gmail.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
slin1237
approved these changes
Jan 8, 2026
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.
What this PR does
This PR adds proper owner reference management to RBAC resources (ServiceAccount, Role, RoleBinding) to enable automatic garbage collection and prevent resource leaks.
Why we need it
Previously, RBAC resources created by the InferenceService controller did not have proper owner references set, which caused:
Fixes #
How to test
go test -v ./pkg/controller/v1beta1/inferenceservice/reconcilers/rbac/
example
apiVersion: ome.io/v1beta1 kind: InferenceService metadata: name: qwen3-0-6b spec: model: name: qwen3-0-6b runtime: name: srt-qwen3-0-6b router: minReplicas: 1 maxReplicas: 1 engine: minReplicas: 1 maxReplicas: 1before
after Role/qwen3-0-6b-router, RoleBinding/qwen3-0-6b-router, ServiceAccount/qwen3-0-6b-router
Checklist
make testpasses locally