From 88121e0747c03084c233d22fadfd3c227e73a885 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 11 Dec 2017 14:00:46 -0500 Subject: We don't support VolumesFrom or links Signed-off-by: Daniel J Walsh Closes: #118 Approved by: mheon --- cmd/kpod/create.go | 2 -- cmd/kpod/parse.go | 30 ------------------------------ 2 files changed, 32 deletions(-) (limited to 'cmd') diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go index 1b340f96d..fc6e519fa 100644 --- a/cmd/kpod/create.go +++ b/cmd/kpod/create.go @@ -115,7 +115,6 @@ type createConfig struct { group uint32 // group utsMode container.UTSMode //uts volumes []string //volume - volumesFrom []string //volumes-from workDir string //workdir mountLabel string //SecurityOpts processLabel string //SecurityOpts @@ -478,7 +477,6 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er user: uid, group: gid, volumes: c.StringSlice("volume"), - volumesFrom: c.StringSlice("volumes-from"), workDir: c.String("workdir"), } diff --git a/cmd/kpod/parse.go b/cmd/kpod/parse.go index 7f6fc78df..53d49c36c 100644 --- a/cmd/kpod/parse.go +++ b/cmd/kpod/parse.go @@ -449,36 +449,6 @@ func validateMACAddress(val string) (string, error) { //nolint return val, nil } -// validateLink validates that the specified string has a valid link format (containerName:alias). -func validateLink(val string) (string, error) { //nolint - if _, _, err := parseLink(val); err != nil { - return val, err - } - return val, nil -} - -// parseLink parses and validates the specified string as a link format (name:alias) -func parseLink(val string) (string, string, error) { - if val == "" { - return "", "", fmt.Errorf("empty string specified for links") - } - arr := strings.Split(val, ":") - if len(arr) > 2 { - return "", "", fmt.Errorf("bad format for links: %s", val) - } - if len(arr) == 1 { - return val, val, nil - } - // This is kept because we can actually get a HostConfig with links - // from an already created container and the format is not `foo:bar` - // but `/foo:/c1/bar` - if strings.HasPrefix(arr[0], "/") { - _, alias := path.Split(arr[1]) - return arr[0][1:], alias, nil - } - return arr[0], arr[1], nil -} - // parseLoggingOpts validates the logDriver and logDriverOpts // for log-opt and log-driver flags func parseLoggingOpts(logDriver string, logDriverOpt []string) (map[string]string, error) { //nolint -- cgit v1.2.3-54-g00ecf