Make RegistryConfig a typed value in the api.

Remove possible circular dependency that prevented us from using a real
type.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 719886d4352cba3f2cd0092e052bb4cb67d51417
Component: engine
This commit is contained in:
David Calavera
2015-09-07 19:29:33 -04:00
parent e0cf284e09
commit f91e0804c7
4 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ import (
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
var (
@@ -96,7 +97,7 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
}
if err != nil {
if types.IsTimeout(err) || strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") {
if utils.IsTimeout(err) || strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") {
return serverResp, errConnectionFailed
}
-21
View File
@@ -1,21 +0,0 @@
package types
import (
"net"
"net/url"
)
// IsTimeout takes an error returned from (generally) the http package and determines if it is a timeout error.
func IsTimeout(err error) bool {
switch e := err.(type) {
case net.Error:
return e.Timeout()
case *url.Error:
if t, ok := e.Err.(net.Error); ok {
return t.Timeout()
}
return false
default:
return false
}
}
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/docker/docker/daemon/network"
"github.com/docker/docker/pkg/version"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
)
@@ -201,7 +202,7 @@ type Info struct {
KernelVersion string
OperatingSystem string
IndexServerAddress string
RegistryConfig interface{}
RegistryConfig *registry.ServiceConfig
InitSha1 string
InitPath string
NCPU int