summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorLuap99 <45212748+Luap99@users.noreply.github.com>2020-11-30 18:04:55 +0100
committerPaul Holzinger <paul.holzinger@web.de>2020-11-30 18:10:26 +0100
commitf3402c73d4a21dca68573babb3554c13cb878505 (patch)
treea8fe137a53091a3c7f9ad57574dee79a17484fd4 /pkg/specgen
parentfc85ec942ee3273f5ad56381a0f6b9e78aea59bf (diff)
downloadpodman-f3402c73d4a21dca68573babb3554c13cb878505.tar.gz
podman-f3402c73d4a21dca68573babb3554c13cb878505.tar.bz2
podman-f3402c73d4a21dca68573babb3554c13cb878505.zip
Revert "Allow multiple --network flags for podman run/create"
As described in issue #8507 this commit contains a breaking change which is not wanted in v2.2. We can discuss later if we want this in 3.0 or not. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/namespaces.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go
index 11108a5c1..90c56d366 100644
--- a/pkg/specgen/namespaces.go
+++ b/pkg/specgen/namespaces.go
@@ -272,10 +272,16 @@ 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: