feat(runner): add WithCacheByObject for per-object cache namespace scoping - #301
Open
liangwen12year wants to merge 1 commit into
Open
feat(runner): add WithCacheByObject for per-object cache namespace scoping#301liangwen12year wants to merge 1 commit into
liangwen12year wants to merge 1 commit into
Conversation
|
🚨 Unsigned commits detected! Please sign your commits. For instructions on how to set up GPG/SSH signing and verify your commits, please see GitHub Documentation. |
lphiri
reviewed
Aug 31, 2026
lphiri
left a comment
There was a problem hiding this comment.
LGTM.
This gives users flexibility to limit service account privileges.
liangwen12year
force-pushed
the
feat/runner-cache-by-object
branch
from
August 31, 2026 13:25
0552ff6 to
9d18503
Compare
…oping Add a WithCacheByObject method to Runner that lets downstream consumers configure cache.Options.ByObject for specific resource types. This enables per-object namespace scoping — e.g. restricting the Secret informer to model namespaces — while keeping other informers cluster-wide. Without this, consumers that need namespace-scoped RBAC for secrets (RoleBindings instead of ClusterRoleBindings) cannot use the Runner because the default cache does a cluster-scoped LIST that requires cluster-wide access. Closes llm-d#300 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Wen Liang <liangwen12year@gmail.com>
liangwen12year
force-pushed
the
feat/runner-cache-by-object
branch
from
August 31, 2026 13:51
9d18503 to
f66b1fa
Compare
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.
Summary
WithCacheByObject(map[client.Object]cache.ByObject)method toRunnerByObjectoverrideDefaultNamespaces(set via theNAMESPACEenv var) for the specified object typesMotivation
Downstream consumers (e.g. opendatahub-io/ai-gateway-payload-processing) need to scope the Secret informer to specific namespaces for RBAC hardening. Without this, the default cache does a cluster-scoped
LIST /api/v1/secretsthat requires a ClusterRoleBinding with cluster-wide secrets access. WithWithCacheByObject, the Secret informer can be scoped to model namespaces, allowing namespace-scoped RoleBindings instead.Usage
Changes
cmd/runner/runner.go: AddcacheByObjectfield toRunnerstruct,WithCacheByObjectbuilder method, and wireByObjectintocache.OptionsinRun()cmd/runner/runner_test.go: Unit tests for the new methodCloses #300
🤖 Generated with Claude Code