diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-05-26 23:13:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 23:13:40 +0200 |
commit | d9eb1269257490dddfae3fde2fe57c3009f94287 (patch) | |
tree | 2a05ee02a825f2024fa7151b2514f66cafe330e4 /cmd/podman/common/create_opts.go | |
parent | 5b4ffc7ba79d0c3ad59cce17500c5a98ea686577 (diff) | |
parent | 533d88b6566974c979932bab071e9408580ac7f8 (diff) | |
download | podman-d9eb1269257490dddfae3fde2fe57c3009f94287.tar.gz podman-d9eb1269257490dddfae3fde2fe57c3009f94287.tar.bz2 podman-d9eb1269257490dddfae3fde2fe57c3009f94287.zip |
Merge pull request #10447 from mheon/rootlesscni_default
Add the option of Rootless CNI networking by default
Diffstat (limited to 'cmd/podman/common/create_opts.go')
-rw-r--r-- | cmd/podman/common/create_opts.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index 77ac781a5..76d7345fc 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -8,6 +8,7 @@ import ( "strconv" "strings" + "github.com/containers/common/pkg/config" "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/pkg/api/handlers" "github.com/containers/podman/v3/pkg/cgroups" @@ -140,7 +141,7 @@ func stringMaptoArray(m map[string]string) []string { // ContainerCreateToContainerCLIOpts converts a compat input struct to cliopts so it can be converted to // a specgen spec. -func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroupsManager string) (*ContainerCLIOpts, []string, error) { +func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *config.Config) (*ContainerCLIOpts, []string, error) { var ( capAdd []string cappDrop []string @@ -248,7 +249,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup } // netMode - nsmode, _, err := specgen.ParseNetworkNamespace(string(cc.HostConfig.NetworkMode)) + nsmode, _, err := specgen.ParseNetworkNamespace(string(cc.HostConfig.NetworkMode), true) if err != nil { return nil, nil, err } @@ -507,7 +508,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup cliOpts.Restart = policy } - if cc.HostConfig.MemorySwappiness != nil && (!rootless.IsRootless() || rootless.IsRootless() && cgroupsv2 && cgroupsManager == "systemd") { + if cc.HostConfig.MemorySwappiness != nil && (!rootless.IsRootless() || rootless.IsRootless() && cgroupsv2 && rtc.Engine.CgroupManager == "systemd") { cliOpts.MemorySwappiness = *cc.HostConfig.MemorySwappiness } else { cliOpts.MemorySwappiness = -1 |