docs: update buildgc example config to use new buildkit v0.17 options#6579
docs: update buildgc example config to use new buildkit v0.17 options#6579thaJeztah merged 1 commit intodocker:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@crazy-max was this one good to go, or changes needed? |
docs/reference/dockerd.md
Outdated
| "gc": { | ||
| "enabled": true, | ||
| "defaultKeepStorage": "10GB", | ||
| "reservedSpace": "10GB", |
There was a problem hiding this comment.
afaics this is called defaultReservedSpace
There was a problem hiding this comment.
yes this is defaultReservedSpace: https://github.com/moby/moby/blob/e7d7771bce74e6120b472c02fd59d0d950f043d3/daemon/config/builder.go#L89
There was a problem hiding this comment.
The struct doesn't set an explicit JSON name; does that mean it's technically with a capital D? Is that something we should change in moby to be explicit if we want it to be lowercase?
There was a problem hiding this comment.
Parsing is case-insensitive
Yes, and no; the default is to do fuzzy matching, and Go will pick the best match, but in a struct like this, case matters;
type Foo struct {
Hello string
HELLO string `json:"hello"`
}If no name is given, the default name used when marshaling is CamelCase, so without explicitly specifying the JSON label, it means that it would be fune unmarshaling defaultReservedSpace, but when marshaling, it would use DefaultReservedSpace, which could happen if the daemon would either print its config, or write it to disk.
JSON-schema also isn't case-insensitive, so if we'd wanted to provide a schema for these files, we should be explicit, and same for Go's JSON "v2" that's currently being worked on; https://go.dev/blog/jsonv2-exp
Signed-off-by: David Karlsson <[email protected]>
f26ef87 to
e0d30db
Compare
Signed-off-by: David Karlsson [email protected]
- What I did
Updated the example builder gc config in the dockerd reference to use the new
options introduced in buildkit v0.17.
- How I did it
Tested manually
A couple small inconsistencies I noticed when doing this:
filterfield indaemon.jsonuses a single=to assign filters, whereas builder uses==, for example:type==source.git.checkoutdaemon.jsonare human-readable bytes. But BuildKit also allows percentage values. Attempting to set eg"minFreeSpace": "20%"results in config parse error.- A picture of a cute animal (not mandatory but encouraged)