summaryrefslogtreecommitdiff
path: root/pkg/specgen/namespaces.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-11-19 12:34:00 +0100
committerPaul Holzinger <paul.holzinger@web.de>2020-11-20 17:02:48 +0100
commitf441190d10ca3d41e01a076e4b9b3a63746888b6 (patch)
treeed06266a33807209480cfcd5a209beea3fa8d63f /pkg/specgen/namespaces.go
parenta18365c908d45a8ee9348c5e32a240a7b9a4091b (diff)
downloadpodman-f441190d10ca3d41e01a076e4b9b3a63746888b6.tar.gz
podman-f441190d10ca3d41e01a076e4b9b3a63746888b6.tar.bz2
podman-f441190d10ca3d41e01a076e4b9b3a63746888b6.zip
Allow multiple --network flags for podman run/create
We allow a container to be connected to several cni networks but only if they are listed comma sperated. This is not intuitive for users especially since the flag parsing allows multiple string flags but only would take the last value. see: spf13/pflag#72 Also get rid of the extra parsing logic for pods. The invalid options are already handled by `pkg/specgen`. A test is added to prevent a future regression. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/specgen/namespaces.go')
-rw-r--r--pkg/specgen/namespaces.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go
index 90c56d366..11108a5c1 100644
--- a/pkg/specgen/namespaces.go
+++ b/pkg/specgen/namespaces.go
@@ -272,16 +272,10 @@ func ParseNetworkNamespace(ns string) (Namespace, []string, error) {
toReturn.NSMode = Private
case strings.HasPrefix(ns, "ns:"):
split := strings.SplitN(ns, ":", 2)
- if len(split) != 2 {
- return toReturn, nil, errors.Errorf("must provide a path to a namespace when specifying ns:")
- }
toReturn.NSMode = Path
toReturn.Value = split[1]
case strings.HasPrefix(ns, "container:"):
split := strings.SplitN(ns, ":", 2)
- if len(split) != 2 {
- return toReturn, nil, errors.Errorf("must provide name or ID or a container when specifying container:")
- }
toReturn.NSMode = FromContainer
toReturn.Value = split[1]
default: