diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-17 10:13:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-17 10:13:18 -0700 |
commit | bf5ffdafb40f32fac891a8cd5fc64cfd5b77674f (patch) | |
tree | bfebcc8f02d5714e90e50f903374e6c0f6bc2cea /cmd/podman/shared/intermediate_varlink.go | |
parent | 799d4667c1c33ac025741e2082739999f5b4563a (diff) | |
parent | 3c0147e55916335ea605972999c594fdf52716e8 (diff) | |
download | podman-bf5ffdafb40f32fac891a8cd5fc64cfd5b77674f.tar.gz podman-bf5ffdafb40f32fac891a8cd5fc64cfd5b77674f.tar.bz2 podman-bf5ffdafb40f32fac891a8cd5fc64cfd5b77674f.zip |
Merge pull request #2917 from baude/remotestart
podman-remote start
Diffstat (limited to 'cmd/podman/shared/intermediate_varlink.go')
-rw-r--r-- | cmd/podman/shared/intermediate_varlink.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cmd/podman/shared/intermediate_varlink.go b/cmd/podman/shared/intermediate_varlink.go index 95a0d6287..d62a65955 100644 --- a/cmd/podman/shared/intermediate_varlink.go +++ b/cmd/podman/shared/intermediate_varlink.go @@ -4,8 +4,10 @@ package shared import ( "fmt" + "github.com/containers/libpod/cmd/podman/cliconfig" "github.com/containers/libpod/cmd/podman/varlink" + "github.com/containers/libpod/pkg/rootless" "github.com/pkg/errors" ) @@ -318,6 +320,12 @@ func VarlinkCreateToGeneric(opts iopodman.Create) GenericCLIResults { // We do not get a default network over varlink. Unlike the other default values for some cli // elements, it seems it gets set to the default anyway. + var memSwapDefault int64 = -1 + netModeDefault := "bridge" + if rootless.IsRootless() { + netModeDefault = "slirp4netns" + } + m := make(map[string]GenericCLIResult) m["add-host"] = stringSliceFromVarlink(opts.AddHost, "add-host", nil) m["annotation"] = stringSliceFromVarlink(opts.Annotation, "annotation", nil) @@ -374,10 +382,10 @@ func VarlinkCreateToGeneric(opts iopodman.Create) GenericCLIResults { m["memory"] = stringFromVarlink(opts.Memory, "memory", nil) m["memory-reservation"] = stringFromVarlink(opts.MemoryReservation, "memory-reservation", nil) m["memory-swap"] = stringFromVarlink(opts.MemorySwap, "memory-swap", nil) - m["memory-swappiness"] = int64FromVarlink(opts.MemorySwappiness, "memory-swappiness", nil) + m["memory-swappiness"] = int64FromVarlink(opts.MemorySwappiness, "memory-swappiness", &memSwapDefault) m["name"] = stringFromVarlink(opts.Name, "name", nil) - m["net"] = stringFromVarlink(opts.Net, "net", nil) - m["network"] = stringFromVarlink(opts.Network, "network", nil) + m["net"] = stringFromVarlink(opts.Net, "net", &netModeDefault) + m["network"] = stringFromVarlink(opts.Network, "network", &netModeDefault) m["no-hosts"] = boolFromVarlink(opts.NoHosts, "no-hosts", false) m["oom-kill-disable"] = boolFromVarlink(opts.OomKillDisable, "oon-kill-disable", false) m["oom-score-adj"] = intFromVarlink(opts.OomScoreAdj, "oom-score-adj", nil) |