-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Remove deprecated keep-storage
parameter from /build/prune
API
#50733
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
base: master
Are you sure you want to change the base?
Conversation
@vvoland 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
- Remove keep-storage parameter from swagger.yaml API specification - Remove KeepStorage field from CachePruneOptions struct - Remove client-side logic for setting keep-storage query parameter - Remove server-side fallback logic for keep-storage in API v1.49+ - Remove backward compatibility logic in builder.go - Add comprehensive tests to validate keep-storage is no longer sent - Maintain backward compatibility for API versions < v1.49 Co-authored-by: vvoland <5046555+vvoland@users.noreply.github.com>
/build/prune
Remove deprecates keep-storage
keep-storage
parameter from /build/prune
API
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.
Pull Request Overview
This PR removes the deprecated keep-storage
parameter from the /build/prune
API endpoint, which was scheduled for removal in API v1.49. The removal maintains proper API versioning while cleaning up legacy code.
- Completely removes
keep-storage
parameter support from API v1.49+ while maintaining backward compatibility for older API versions - Removes the deprecated
KeepStorage
field from type definitions and client implementation - Adds comprehensive test coverage to validate the parameter is no longer sent in API requests
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
api/swagger.yaml | Removes deprecated keep-storage parameter from API specification |
api/types/build/cache.go | Removes KeepStorage field from CachePruneOptions struct |
client/build_prune.go | Removes client-side logic for setting keep-storage query parameter |
client/build_prune_test.go | Adds comprehensive tests validating parameter removal |
daemon/server/router/build/build_routes.go | Updates version logic to remove keep-storage support for API v1.49+ |
daemon/internal/builder-next/builder.go | Removes backward compatibility mapping from KeepStorage to ReservedSpace |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
if opts.KeepStorage != 0 { | ||
query.Set("keep-storage", strconv.Itoa(int(opts.KeepStorage))) | ||
} |
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.
This probably won't work well, as it would remove the feature for older API versions (which the client supports)
The
keep-storage
parameter for the/build/prune
API endpoint was deprecated in favor ofreserved-space
and scheduled for removal in API v1.49. Since the current API version is v1.52, this PR removes the deprecated parameter completely.Changes Made
API Specification
keep-storage
parameter fromapi/swagger.yaml
Type Definitions
KeepStorage
field fromCachePruneOptions
struct inapi/types/build/cache.go
Client Implementation
keep-storage
query parameter inclient/build_prune.go
Server Implementation
daemon/server/router/build/build_routes.go
to completely removekeep-storage
support for API v1.49+daemon/internal/builder-next/builder.go
Backward Compatibility
The removal maintains proper API versioning:
keep-storage
(unchanged)keep-storage
andreserved-space
with fallback (unchanged)reserved-space
,max-used-space
, andmin-free-space
(new behavior)Daemon configuration files continue to support the deprecated
keepStorage
field for backward compatibility, as this is a separate concern from the API parameter.Testing
Added comprehensive test coverage in
client/build_prune_test.go
that validates:keep-storage
parameter is never included in API requestsreserved-space
,max-used-space
,min-free-space
,all
,filters
) work correctlyAll existing tests continue to pass, confirming no regressions were introduced.
Fixes #50131.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
no-such-host.invalid
/tmp/go-build3574130764/b001/client.test -test.paniconexit0 -test.timeout=10m0s -test.v=true
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.