Move interfaces.LRU to lru.LRU#11566
Merged
iain-macdonald merged 3 commits intomasterfrom Mar 12, 2026
Merged
Conversation
vanja-p
approved these changes
Mar 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR relocates the generic LRU cache interface from server/interfaces into the server/util/lru package and updates callers to reference the new lru.LRU[...] type, decoupling most code from the concrete LRU implementation.
Changes:
- Moved the
LRU[V]interface definition fromserver/interfaces/interfaces.gotoserver/util/lru/lru.go. - Updated
lru.NewLRUto return thelru.LRU[V]interface and made the concrete implementation unexported. - Updated multiple caches and helpers to use
lru.LRU[...]instead ofinterfaces.LRU[...]/*lru.LRU[...].
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| server/util/lru/lru.go | Introduces exported LRU interface in-package, makes implementation unexported, and changes NewLRU to return the interface. |
| server/util/claims/claims.go | Switches claims parser cache field to lru.LRU[*Claims]. |
| server/interfaces/interfaces.go | Removes the LRU interface from the shared interfaces package. |
| server/backends/memory_cache/memory_cache.go | Updates in-memory cache ledger to depend on lru.LRU[[]byte]. |
| server/backends/disk_cache/disk_cache.go | Updates disk cache partition ledger to use lru.LRU[*fileRecord]. |
| enterprise/server/util/oci/oci.go | Updates resolver tag->digest cache type to lru.LRU[...]. |
| enterprise/server/remoteauth/remoteauth.go | Updates remote-auth JWT cache type to lru.LRU[string]. |
| enterprise/server/remote_execution/filecache/filecache.go | Updates filecache LRU field type to lru.LRU[*entry]. |
| enterprise/server/remote_execution/copy_on_write/copy_on_write.go | Updates mmap LRU field type to lru.LRU[*Mmap]. |
| enterprise/server/remote_execution/containers/podman/podman.go | Updates image-existence cache to lru.LRU[time.Time]. |
| enterprise/server/oci/ocifetcher/ocifetcher.go | Updates puller LRU field type to lru.LRU[*pullerLRUEntry]. |
| enterprise/server/iprules/iprules.go | Updates IP rule cache to lru.LRU[*ipRuleCacheEntry]. |
| enterprise/server/backends/distributed/distributed.go | Updates lookaside cache to lru.LRU[lookasideCacheEntry]. |
| enterprise/server/backends/authdb/authdb.go | Updates API key group cache to lru.LRU[*apiKeyGroupCacheEntry]. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.