client: add reset option for local cache exporter#6612
Open
jirimoravcik wants to merge 1 commit intomoby:masterfrom
Open
client: add reset option for local cache exporter#6612jirimoravcik wants to merge 1 commit intomoby:masterfrom
reset option for local cache exporter#6612jirimoravcik wants to merge 1 commit intomoby:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a reset=true option to the local cache exporter so exported cache directories can be cleaned up (unreferenced blobs removed) after export, preventing unbounded growth. This fits into the client-side cache export flow that already updates the local index.json after a solve.
Changes:
- Parse a new
resetattribute fortype=localcache exports and trigger a post-export cleanup. - Implement
resetCacheStoreto compute referenced blobs fromindex.jsonand delete unreferenced blobs. - Add unit + integration tests and document the new option in README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
client/solve.go |
Parses reset attr, tracks stores to reset, and implements blob cleanup after export. |
client/solve_resetcache_test.go |
Unit tests for resetCacheStore behavior (currently image-manifest oriented). |
client/client_test.go |
Integration test for reset=true behavior with local cache export. |
README.md |
Documents the new reset=<true|false> option for local cache exporter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add `reset=true` attribute to the local cache exporter that removes unreferenced blobs from the cache directory after export, preventing unbounded growth. Signed-off-by: Jiří Moravčík <jiri.moravcik@gmail.com>
d06efaa to
20a5427
Compare
Author
|
Fixed the lint, other errors seem to be |
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.
Add
reset=trueattribute to the local cache exporter that removes unreferenced blobs from the cache directory after export, preventing unbounded growth.The logic is very simple:
I think
cleanupcould also work as the attribute name.Resolves #1896