Skip to content

buildkitd: avoid panic for lone quote in GC policy config - #7209

Merged
tonistiigi merged 1 commit into
moby:masterfrom
crazy-max:fix-gcpolicy-strip-quotes
Sep 29, 2026
Merged

tonistiigi merged 1 commit into
moby:masterfrom
crazy-max:fix-gcpolicy-strip-quotes

Conversation

@crazy-max

Copy link
Copy Markdown
Member

A GC policy value containing only a double quote causes buildkitd to panic while loading its config:

[[worker.oci.gcpolicy]]
keepDuration = '"'

Run buildkitd --config config.toml or docker buildx create --buildkitd-config c.toml.

Previously, parsing panicked with slice bounds out of range [1:0]. With this change, it returns an invalid duration error. The same panic affected reservedSpace, maxUsedSpace, and minFreeSpace.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max added this to the v0.34.0 milestone Sep 28, 2026
@crazy-max
crazy-max marked this pull request as ready for review September 28, 2026 15:42
@tonistiigi
tonistiigi merged commit 09c0e7a into moby:master Sep 29, 2026
216 checks passed
@crazy-max
crazy-max deleted the fix-gcpolicy-strip-quotes branch September 29, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants