1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/types
Sebastiaan van Stijn a3d4238b9c
Add "Warnings" to /info endpoint, and move detection to the daemon
When requesting information about the daemon's configuration through the `/info`
endpoint, missing features (or non-recommended settings) may have to be presented
to the user.

Detecting these situations, and printing warnings currently is handled by the
cli, which results in some complications:

- duplicated effort: each client has to re-implement detection and warnings.
- it's not possible to generate warnings for reasons outside of the information
  returned in the `/info` response.
- cli-side detection has to be updated for new conditions. This means that an
  older cli connecting to a new daemon may not print all warnings (due to
  it not detecting the new conditions)
- some warnings (in particular, warnings about storage-drivers) depend on
  driver-status (`DriverStatus`) information. The format of the information
  returned in this field is not part of the API specification and can change
  over time, resulting in cli-side detection no longer being functional.

This patch adds a new `Warnings` field to the `/info` response. This field is
to return warnings to be presented by the user.

Existing warnings that are currently handled by the CLI are copied to the daemon
as part of this patch; This change is backward-compatible with existing
clients; old client can continue to use the client-side warnings, whereas new
clients can skip client-side detection, and print warnings that are returned by
the daemon.

Example response with this patch applied;

```bash
curl --unix-socket /var/run/docker.sock http://localhost/info | jq .Warnings
```

```json
[
  "WARNING: bridge-nf-call-iptables is disabled",
  "WARNING: bridge-nf-call-ip6tables is disabled"
]
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-21 11:36:15 +02:00
..
backend distribution: fix passing platform struct to puller 2018-06-27 14:59:31 -07:00
blkiodev Add canonical import comment 2018-02-05 16:51:57 -05:00
container api: add configurable MaskedPaths and ReadOnlyPaths to the API 2018-06-05 12:33:14 -04:00
events Add canonical import comment 2018-02-05 16:51:57 -05:00
filters Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
image use swagger support for « title » as generated types names for inline schema 2017-12-13 18:54:37 +01:00
mount Add canonical import comment 2018-02-05 16:51:57 -05:00
network Move network conversions out of API router 2018-06-27 17:11:29 -07:00
plugins/logdriver Add partial log metadata to log driver proto 2018-08-10 20:44:30 -07:00
registry Add canonical import comment 2018-02-05 16:51:57 -05:00
strslice Add canonical import comment 2018-02-05 16:51:57 -05:00
swarm Global Default Address Pool feature support 2018-08-20 15:07:08 -04:00
time Improve GetTimestamp parsing 2018-05-20 13:07:17 +02:00
versions Add canonical import comment 2018-02-05 16:51:57 -05:00
volume Fix golint warning on generated "volume" types 2018-07-13 16:58:59 +02:00
auth.go Add canonical import comment 2018-02-05 16:51:57 -05:00
client.go api: Change Platform field back to string (temporary workaround) 2018-07-03 22:33:42 +00:00
configs.go Move network conversions out of API router 2018-06-27 17:11:29 -07:00
error_response.go Update to inline comments. 2016-10-31 11:13:41 -04:00
graph_driver_data.go Generate GraphDriver from spec, and fix up image spec. 2017-01-03 11:47:47 -05:00
id_response.go Add an IDResponse type 2016-10-31 11:16:02 -04:00
image_delete_response_item.go Generate ImageDeleteResponse from swagger spec. 2017-01-03 11:47:47 -05:00
image_summary.go Generate api/types:Image from the swagger spec 2016-10-20 13:24:23 -07:00
plugin.go Move plugin client creation to the extension point 2018-05-25 15:18:53 -04:00
plugin_device.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_env.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_interface_type.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_mount.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_responses.go Add canonical import comment 2018-02-05 16:51:57 -05:00
port.go Describe IP field of Port definition 2018-05-15 12:09:42 +02:00
seccomp.go Add canonical import comment 2018-02-05 16:51:57 -05:00
service_update_response.go Return warnings from service create and service update when digest pinning fails 2016-11-18 09:31:31 -08:00
stats.go Add canonical import comment 2018-02-05 16:51:57 -05:00
types.go Add "Warnings" to /info endpoint, and move detection to the daemon 2018-08-21 11:36:15 +02:00
volume.go Merge pull request #34186 from thaJeztah/api-update-example-data 2017-07-20 09:38:28 +02:00