diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-06-29 14:18:46 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-06-30 13:32:27 -0400 |
commit | 092902b455551d7353163c1e6d322f3605b9a897 (patch) | |
tree | 40b067377bda67d7d4002100e7210547bf4317f5 /cmd/podman/common | |
parent | 61b7beaf8e595bdc1305a12b49e26a25bbc2bc42 (diff) | |
download | podman-092902b455551d7353163c1e6d322f3605b9a897.tar.gz podman-092902b455551d7353163c1e6d322f3605b9a897.tar.bz2 podman-092902b455551d7353163c1e6d322f3605b9a897.zip |
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 <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/common')
-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 |