From 092902b455551d7353163c1e6d322f3605b9a897 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 29 Jun 2021 14:18:46 -0400 Subject: Handle advanced --network options in podman play kube Since Podman create/run can support this, so should play. Fixes: https://github.com/containers/podman/issues/10807 Signed-off-by: Daniel J Walsh --- cmd/podman/common/netflags.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'cmd') 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 -- cgit v1.2.3-54-g00ecf