From f3402c73d4a21dca68573babb3554c13cb878505 Mon Sep 17 00:00:00 2001 From: Luap99 <45212748+Luap99@users.noreply.github.com> Date: Mon, 30 Nov 2020 18:04:55 +0100 Subject: 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 --- pkg/specgen/namespaces.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg') 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: -- cgit v1.2.3-54-g00ecf