Move bundle cache out of lru cache#7130
Open
sorindumitru wants to merge 1 commit into
Open
Conversation
sorindumitru
requested review from
MarcosDY,
amartinezfayo and
rturner3
as code owners
July 8, 2026 18:59
sorindumitru
force-pushed
the
extract-bundle-cache
branch
from
July 8, 2026 19:01
7a0c140 to
7c6e084
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the agent manager’s bundle handling by separating the shared bundle stream/source (BundleCache) from the workload LRU cache, similar to prior JWT-SVID cache separation, with the stated goal of no functional change.
Changes:
- Introduces a dedicated
BundleCacheowned bymanager, and wires it into the SVID rotator (BundleStream) and manager bundle accessors. - Removes bundle-stream/source responsibilities from
LRUCacheand trims themanager.Cacheinterface accordingly. - Enhances
BundleCache.Update()to avoid unnecessary updates and to preserve the agent trust domain bundle if absent from updates.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/agent/manager/sync.go | Updates the shared bundle cache during synchronization. |
| pkg/agent/manager/manager.go | Routes bundle APIs (GetBundle(s), GetX509Bundle, bundle stream) through the new shared BundleCache; trims Cache interface. |
| pkg/agent/manager/config.go | Creates and injects the new BundleCache (including wiring rotator to its bundle stream). |
| pkg/agent/manager/cache/lru_cache.go | Removes embedded bundle cache/source behavior from LRUCache. |
| pkg/agent/manager/cache/lru_cache_test.go | Adjusts bundle-change tests to reflect the new standalone bundle cache. |
| pkg/agent/manager/cache/bundle_cache.go | Adds change-detection/preservation logic to BundleCache.Update(). |
| pkg/agent/api/delegatedidentity/v1/service_test.go | Updates test fake manager to produce bundle streams via BundleCache. |
Comment on lines
+116
to
+118
| // Update the shared bundle cache with the latest bundles | ||
| m.bundleCache.Update(cacheUpdate.Bundles) | ||
|
|
Comment on lines
+135
to
+136
| func TestLRUCacheBundleChanges(t *testing.T) { | ||
| cache := newTestLRUCache(t) | ||
| bundleCache := NewBundleCache(trustDomain1, bundleV1) |
sorindumitru
force-pushed
the
extract-bundle-cache
branch
2 times, most recently
from
July 8, 2026 19:56
1e9f1ed to
3f42322
Compare
Similar to how we moved the JWT-SVIDs out of the cache, it makes a lot more sense to keep this outside of the LRU cache. Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
sorindumitru
force-pushed
the
extract-bundle-cache
branch
from
July 9, 2026 04:51
3f42322 to
1a0cf7f
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.
Pull Request check list
Affected functionality
There should be no functionality change
Description of change
Similar to how we moved the JWT-SVIDs out of the cache, it makes a lot more sense to keep this outside of the LRU cache.