mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
Merge pull request #26116 from inknos/compat-post-containers-create-cgroupsnsmode
compat: Add CgroupnsMode to POST /containers/create
This commit is contained in:
@ -507,6 +507,14 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*container.InspectResp
|
||||
}
|
||||
sort.Strings(hc.Binds)
|
||||
|
||||
// Map CgroupMode to CgroupnsMode for Docker API compatibility
|
||||
switch inspect.HostConfig.CgroupMode {
|
||||
case "private":
|
||||
hc.CgroupnsMode = container.CgroupnsModePrivate
|
||||
case "host":
|
||||
hc.CgroupnsMode = container.CgroupnsModeHost
|
||||
}
|
||||
|
||||
// k8s-file == json-file
|
||||
if hc.LogConfig.Type == define.KubernetesLogging {
|
||||
hc.LogConfig.Type = define.JSONLogging
|
||||
|
@ -474,6 +474,7 @@ func cliOpts(cc handlers.CreateContainerConfig, rtc *config.Config) (*entities.C
|
||||
User: cc.Config.User,
|
||||
UserNS: string(cc.HostConfig.UsernsMode),
|
||||
UTS: string(cc.HostConfig.UTSMode),
|
||||
CgroupNS: string(cc.HostConfig.CgroupnsMode),
|
||||
Mount: mounts,
|
||||
VolumesFrom: cc.HostConfig.VolumesFrom,
|
||||
Workdir: cc.Config.WorkingDir,
|
||||
|
Reference in New Issue
Block a user