-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
info: add Features field to show feature-configuration #43880
Conversation
This adds a new Features field for API v1.43 and up, which contains the current configuration of features that have been either enabled or disabled in the daemon configuration. With this patch: ```bash mkdir -p /etc/docker echo '{"features":{"containerd-snapshotter":true}}' > /etc/docker/daemon.json dockerd & curl -s --unix-socket /var/run/docker.sock http://localhost/info | jq .Features [ "containerd-snapshotter=enabled" ] ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
I should add that this shows the configuration currently; wondering if we would need to change this to show the current status (e.g. for features that are enabled by default) |
We discussed this in the maintainers meeting;
Moving this back to draft, and I'll have a look at exposing the information as |
Just having labels (with a prefix like |
One real use case for the features list is for buildx: it can use this information to know if its docker driver can support multi-platform images |
// | ||
// If a certain feature doesn't appear in this list then it's unset | ||
// (i.e. neither true nor false). | ||
Features []string `json:"Features,omitempty"` |
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.
Any reason this is a []string
with a micro-format instead of a map[string]bool
?
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.
either map[string]bool
or map[string]string
(for status, enabled
| disabled
| ..)
but please don't use yet another string microformat within a JSON 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.
Yeah, this was a 5 minute, quick implementation for discussion in the maintainers call; we did discuss using a map instead (possibly with custom marshaling to return a consistent order in the API response)
But then we also discussed if we really wanted this, because
- these options don't reflect the current state of these features (only if they're overridden)
- for the builder version; this is already exposed through other ways
- for the snapshotters, it'll be more useful to know what snapshotter is used (and what other snapshotters are available); both of those would effectively replace what "graphdriver" is currently showing, so the preference was to explore using that instead.
w.r.t. buildx; I wonder if that's information that should be part of the buildkit API 🤔 (/cc @crazy-max )
closing in favour of #43983 |
This adds a new Features field for API v1.43 and up, which contains the current
configuration of features that have been either enabled or disabled in the daemon
configuration.
With this patch:
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)