diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-21 15:56:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 15:56:53 -0400 |
commit | 413929babd078f3d1281994398501997c1a2d4d1 (patch) | |
tree | 81833e3654a63e042f7d77b854740003fa0d8b4a /cmd/podman/common/netflags.go | |
parent | 2ed4a0e35f6182b79976979ecf3f3ab9010417bd (diff) | |
parent | 1cd2b746d0d6a4e8c074bc444b4a4a2afef30d5d (diff) | |
download | podman-413929babd078f3d1281994398501997c1a2d4d1.tar.gz podman-413929babd078f3d1281994398501997c1a2d4d1.tar.bz2 podman-413929babd078f3d1281994398501997c1a2d4d1.zip |
Merge pull request #5905 from mheon/redo_namespaces
Modify namespace generation code for specgen
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 1a47733e7..a439eb792 100644 --- a/cmd/podman/common/netflags.go +++ b/cmd/podman/common/netflags.go @@ -5,6 +5,7 @@ import ( "github.com/containers/libpod/cmd/podman/parse" "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" @@ -159,9 +160,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 |