diff --git a/opts/opts.go b/opts/opts.go index 48b9d842aa..78059739a8 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -352,7 +352,7 @@ func ValidateHost(val string) (string, error) { } // ParseHost and set defaults for a Daemon host string -func ParseHost(defaultHTTPHost, val string) (string, error) { +func ParseHost(val string) (string, error) { host, err := parsers.ParseDockerDaemonHost(DefaultTCPHost, DefaultUnixSocket, val) if err != nil { return val, err diff --git a/opts/opts_test.go b/opts/opts_test.go index f1a4bea9f2..0e4e9562e7 100644 --- a/opts/opts_test.go +++ b/opts/opts_test.go @@ -458,12 +458,12 @@ func TestParseHost(t *testing.T) { } for value, errorMessage := range invalid { - if _, err := ParseHost(defaultHTTPHost, value); err == nil || err.Error() != errorMessage { + if _, err := ParseHost(value); err == nil || err.Error() != errorMessage { t.Fatalf("Expected an error for %v with [%v], got [%v]", value, errorMessage, err) } } for value, expected := range valid { - if actual, err := ParseHost(defaultHTTPHost, value); err != nil || actual != expected { + if actual, err := ParseHost(value); err != nil || actual != expected { t.Fatalf("Expected for %v [%v], got [%v, %v]", value, expected, actual, err) } }