diff options
Diffstat (limited to 'cmd/podman/common/netflags.go')
-rw-r--r-- | cmd/podman/common/netflags.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd/podman/common/netflags.go b/cmd/podman/common/netflags.go index 78cfe2f13..aa8714b50 100644 --- a/cmd/podman/common/netflags.go +++ b/cmd/podman/common/netflags.go @@ -2,7 +2,6 @@ package common import ( "net" - "strings" "github.com/containers/common/pkg/completion" "github.com/containers/podman/v3/cmd/podman/parse" @@ -204,17 +203,13 @@ func NetFlagsToNetOptions(cmd *cobra.Command, netnsFromConfig bool) (*entities.N return nil, err } - parts := strings.SplitN(network, ":", 2) - - ns, cniNets, err := specgen.ParseNetworkNamespace(network, containerConfig.Containers.RootlessNetworking == "cni") + ns, cniNets, options, err := specgen.ParseNetworkString(network) if err != nil { return nil, err } - if len(parts) > 1 { - opts.NetworkOptions = make(map[string][]string) - opts.NetworkOptions[parts[0]] = strings.Split(parts[1], ",") - cniNets = nil + if len(options) > 0 { + opts.NetworkOptions = options } opts.Network = ns opts.CNINetworks = cniNets |