diff --git a/pkg/opts/opts.go b/pkg/opts/opts.go index a1b8752bad..4f5897c796 100644 --- a/pkg/opts/opts.go +++ b/pkg/opts/opts.go @@ -92,22 +92,12 @@ func ValidateAttach(val string) (string, error) { } func ValidateLink(val string) (string, error) { - if _, err := parseLink(val); err != nil { + if _, err := utils.PartParser("name:alias", val); err != nil { return val, err } return val, nil } -// FIXME: this is a duplicate of docker.utils.parseLink. -// it can't be moved to a separate links/ package because -// links depends on Container which is defined in the core. -// -// Links come in the format of -// name:alias -func parseLink(rawLink string) (map[string]string, error) { - return utils.PartParser("name:alias", rawLink) -} - func ValidatePath(val string) (string, error) { var containerPath string diff --git a/server.go b/server.go index 85d56afdb6..52f5f14c0a 100644 --- a/server.go +++ b/server.go @@ -1995,7 +1995,7 @@ func (srv *Server) RegisterLinks(container *runtime.Container, hostConfig *runco if hostConfig != nil && hostConfig.Links != nil { for _, l := range hostConfig.Links { - parts, err := parseLink(l) + parts, err := utils.PartParser("name:alias", l) if err != nil { return err } diff --git a/utils.go b/utils.go deleted file mode 100644 index 0fda006860..0000000000 --- a/utils.go +++ /dev/null @@ -1,16 +0,0 @@ -package docker - -import ( - "github.com/dotcloud/docker/archive" - "github.com/dotcloud/docker/utils" -) - -type Change struct { - archive.Change -} - -// Links come in the format of -// name:alias -func parseLink(rawLink string) (map[string]string, error) { - return utils.PartParser("name:alias", rawLink) -}