summaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/common')
-rw-r--r--cmd/podman/common/default.go6
-rw-r--r--cmd/podman/common/netflags.go11
-rw-r--r--cmd/podman/common/specgen.go1
3 files changed, 14 insertions, 4 deletions
diff --git a/cmd/podman/common/default.go b/cmd/podman/common/default.go
index 89316270b..7233b2091 100644
--- a/cmd/podman/common/default.go
+++ b/cmd/podman/common/default.go
@@ -1,5 +1,9 @@
package common
+import (
+ "github.com/containers/libpod/cmd/podman/registry"
+)
+
var (
// DefaultHealthCheckInterval default value
DefaultHealthCheckInterval = "30s"
@@ -11,4 +15,6 @@ var (
DefaultHealthCheckTimeout = "30s"
// DefaultImageVolume default value
DefaultImageVolume = "bind"
+ // Pull in configured json library
+ json = registry.JsonLibrary()
)
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
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 71010feb3..1e857ea01 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -1,7 +1,6 @@
package common
import (
- "encoding/json"
"fmt"
"os"
"path/filepath"