forked from kserve/kserve
-
Notifications
You must be signed in to change notification settings - Fork 51
fix(scheduler): Uses ClusterRole for TokenReview and SAR resources #760
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
Merged
openshift-merge-bot
merged 5 commits into
opendatahub-io:release-v0.15
from
israel-hdez:scheduler-rbac-fix
Jul 31, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
483323f
fix(scheduler): Uses ClusterRole for TokenReview and SAR resources
israel-hdez 9bbdb92
Code review fixes: pierDipi
israel-hdez e05d3ef
Code review fixes: bartoszmajsak & pierDipi
israel-hdez 394fc85
Code review fixes: pierDipi
israel-hdez f4d9031
Fixing test flakiness
israel-hdez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
!llmSvc.DeletionTimestamp.IsZero()- I noticed we don't do it in other places. How about moving this check toDeletefunc as a guard to all types of resources? That would simplify the code below too.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.
But notice that this condition is over
llmSvcinstead ofauthDelegatorBinding. I did this way just to not tamper with the garbage collector for the owned resources which should automatically do the deletion so that, to some extent, it preserves behavior.In practice, I'm not sure how useful the guard in
Deletewill be. I see the pattern in the code is to delete the built expected resource; i.e. it doesn't query for the actual one, so I don't think we will have the timestamp. In any case, I agree that having the guard is good. I'll dd it. Yet, IMO this check overllmSvcshould stay, unless we are OK with the controller trying the delete despite the ownership?Uh oh!
There was an error while loading. Please reload this page.
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.
I was thinking to move this down to Delete and guard in the same fashion - if
expectedis owned by existing resource (owner) we would have a timestamp onowner.But I see now this is about cluster-scoped resource that I missed going quickly through the code. Apologies for the initial noise.
I am not sure about using
Deletefor such a case. This method expects anownerand here it is misleading. Perhaps we should just delete it using available client? The same applies toReconcile. Thinking about it more - maybe we need separate methods for cluster-scoped resources instead of patching the behaviour of the code path not intended for this use-case?Thoughts @pierDipi?
Uh oh!
There was an error while loading. Please reload this page.
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.
Maybe what we want is to allow
nilowner for Reconcile and Delete without having separate paths for cluster-scoped resources?Uh oh!
There was an error while loading. Please reload this page.
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.
I am a bit alergic to
nils as I've seen many methods with couple of those passed out in the wild. That is making the intent blurry, but we can refactor later.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.
I'm not seeing any actionable change. Let me know if I'm misunderstanding.
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.
follow-up :)