moby/opts
Sebastiaan van Stijn ecbfe73193
opts: ParseTCPAddr(): fix validation of hosts to not ignore path elements
There was a discrepancy between what `ParseTCPAddr()` accepted, and what the
daemon was able to use, resulting in the daemon to start, but fail to create
listeners for the specified host.

Before this patch:

    dockerd -H tcp://127.0.0.1:2375/
    INFO[2022-04-03T10:18:06.417502600Z] Starting up
    ...
    failed to load listeners: listen tcp: address tcp/2375/: unknown port

    dockerd -H 127.0.0.1:2375/path
    INFO[2022-04-03T10:18:06.417502600Z] Starting up
    ...
    failed to load listeners: listen tcp: address tcp/5555/path: unknown port

After this patch:

    dockerd -H tcp://127.0.0.1:2375/
    Status: invalid argument "tcp://127.0.0.1:2375/" for "-H, --host" flag: invalid bind address (127.0.0.1:2375/): should not contain a path element
    See 'dockerd --help'., Code: 125

    dockerd -H 127.0.0.1:2375/path
    Status: invalid argument "127.0.0.1:2375/path" for "-H, --host" flag: invalid bind address (127.0.0.1:2375/path): should not contain a path element
    See 'dockerd --help'., Code: 125

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-04 12:50:45 +02:00
..
address_pools.go Fix libnetwork imports 2021-06-01 21:51:23 +00:00
address_pools_test.go Allow user to control the default address pools 2018-04-30 11:14:08 -04:00
env.go opts: simplify ValidateEnv to use os.LookupEnv 2020-08-14 16:58:30 +02:00
env_test.go opts: simplify ValidateEnv to use os.LookupEnv 2020-08-14 16:58:30 +02:00
hosts.go opts: ParseTCPAddr(): fix validation of hosts to not ignore path elements 2022-04-04 12:50:45 +02:00
hosts_test.go opts: ParseTCPAddr(): fix validation of hosts to not ignore path elements 2022-04-04 12:50:45 +02:00
hosts_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
hosts_windows.go opts: unify host-options, and use consts 2020-10-31 16:44:21 +01:00
ip.go Add canonical import comment 2018-02-05 16:51:57 -05:00
ip_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00
opts.go enforce reserve internal labels. 2020-02-12 12:03:35 +08:00
opts_test.go enforce reserve internal labels. 2020-02-12 12:03:35 +08:00
runtime.go Add canonical import comment 2018-02-05 16:51:57 -05:00
ulimit.go goimports: fix imports 2019-09-18 12:56:54 +02:00
ulimit_test.go TestUlimitOpt: fix composite literal uses unkeyed fields (govet) 2019-09-18 12:57:34 +02:00