moby/builder/builder-next
Sebastiaan van Stijn 84036d3e18
daemon/config: change DNSConfig.DNS to a []net.IP
Use a strong type for the DNS IP-addresses so that we can use flags.IPSliceVar,
instead of implementing our own option-type and validation.

Behavior should be the same, although error-messages have slightly changed:

Before this patch:

    dockerd --dns 1.1.1.1oooo --validate
    Status: invalid argument "1.1.1.1oooo" for "--dns" flag: 1.1.1.1oooo is not an ip address
    See 'dockerd --help'., Code: 125

    cat /etc/docker/daemon.json
    {"dns": ["1.1.1.1"]}

    dockerd --dns 2.2.2.2 --validate
    unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: dns: (from flag: [2.2.2.2], from file: [1.1.1.1])

    cat /etc/docker/daemon.json
    {"dns": ["1.1.1.1oooo"]}

    dockerd --validate
    unable to configure the Docker daemon with file /etc/docker/daemon.json: merged configuration validation from file and command line flags failed: 1.1.1.1ooooo is not an ip address

With this patch:

    dockerd --dns 1.1.1.1oooo --validate
    Status: invalid argument "1.1.1.1oooo" for "--dns" flag: invalid string being converted to IP address: 1.1.1.1oooo
    See 'dockerd --help'., Code: 125

    cat /etc/docker/daemon.json
    {"dns": ["1.1.1.1"]}

    dockerd --dns 2.2.2.2 --validate
    unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: dns: (from flag: [2.2.2.2], from file: [1.1.1.1])

    cat /etc/docker/daemon.json
    {"dns": ["1.1.1.1oooo"]}

    dockerd --validate
    unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid IP address: 1.1.1.1oooo

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-11-13 12:22:51 +01:00
..
adapters migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
exporter migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
imagerefchecker remove unneeded "digest" alias for "go-digest" 2022-03-04 14:49:42 +01:00
worker migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
builder.go vendor: github.com/moby/buildkit v0.12.3-dev 2023-10-13 17:05:56 -07:00
controller.go builder-next: make sure worker platforms normalized for containerd 2023-10-30 23:14:34 -07:00
executor_linux.go daemon/config: change DNSConfig.DNS to a []net.IP 2023-11-13 12:22:51 +01:00
executor_nolinux.go vendor: github.com/moby/buildkit v0.12.2 2023-09-21 14:18:45 -06:00
reqbodyhandler.go builder-next: use constants for http status codes 2019-10-13 19:11:24 +02:00