diff options
Diffstat (limited to 'cmd/podman/common/netflags.go')
-rw-r--r-- | cmd/podman/common/netflags.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmd/podman/common/netflags.go b/cmd/podman/common/netflags.go index a63605909..2bb45476b 100644 --- a/cmd/podman/common/netflags.go +++ b/cmd/podman/common/netflags.go @@ -6,6 +6,7 @@ import ( "github.com/containers/libpod/cmd/podman/parse" "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/domain/entities" + "github.com/containers/libpod/pkg/specgen" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -163,9 +164,13 @@ func NetFlagsToNetOptions(cmd *cobra.Command) (*entities.NetOptions, error) { return nil, err } - return nil, errors.Errorf("network %s is not yet supported", network) - // TODO How do I convert a string network to a Specgen.Namespace? - // opts.Network = specgen.Namespace{NSMode: network} + ns, cniNets, err := specgen.ParseNetworkNamespace(network) + if err != nil { + return nil, err + } + + opts.Network = ns + opts.CNINetworks = cniNets } return &opts, err |