1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #4562 from vieux/remove_utils_in_docker_package

Remove utils in docker package
This commit is contained in:
Michael Crosby 2014-03-10 14:27:13 -07:00
commit 3c7206b991
6 changed files with 4 additions and 30 deletions

View file

@ -10,8 +10,8 @@ import (
"github.com/dotcloud/docker/builtins"
"github.com/dotcloud/docker/dockerversion"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/opts"
flag "github.com/dotcloud/docker/pkg/mflag"
"github.com/dotcloud/docker/pkg/opts"
"github.com/dotcloud/docker/sysinit"
"github.com/dotcloud/docker/utils"
)

View file

@ -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

View file

@ -3,8 +3,8 @@ package runconfig
import (
"fmt"
"github.com/dotcloud/docker/nat"
"github.com/dotcloud/docker/opts"
flag "github.com/dotcloud/docker/pkg/mflag"
"github.com/dotcloud/docker/pkg/opts"
"github.com/dotcloud/docker/pkg/sysinfo"
"github.com/dotcloud/docker/utils"
"io/ioutil"

View file

@ -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
}

View file

@ -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)
}