moby/cmd/dockerd/main_linux_test.go
Brian Goff 37a9d6aabe Fix listener parsering regression when no addr set
5008409b5c introduced the usage of
`strings.Cut` to help parse listener addresses.
Part of that also made it error out if no addr is specified after the
protocol spec (e.g. `tcp://`).

Before the change a proto spec without an address just used the default
address for that proto.
e.g. `tcp://` would be `tcp://127.0.0.1:2375`, `unix://` would be
`unix:///var/run/docker.sock`.
Critically, socket activation (`fd://`) never has an address.

This change brings back the old behavior but keeps the usage of
`strings.Cut`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-03-09 23:53:05 +00:00

16 lines
290 B
Go

package main
import (
"testing"
"github.com/docker/docker/pkg/reexec"
)
func TestMain(m *testing.M) {
reexec.Register(testListenerNoAddrCmdPhase1, initListenerTestPhase1)
reexec.Register(testListenerNoAddrCmdPhase2, initListenerTestPhase2)
if reexec.Init() {
return
}
m.Run()
}