mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Fix cgroupParent is wrongly set in dockershim
This commit is contained in:
parent
ae1a7784af
commit
9170e94e2d
@ -124,14 +124,6 @@ func (ds *dockerService) CreateContainer(podSandboxID string, config *runtimeapi
|
|||||||
Binds: generateMountBindings(config.GetMounts()),
|
Binds: generateMountBindings(config.GetMounts()),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply cgroupsParent derived from the sandbox config.
|
|
||||||
if lc := sandboxConfig.GetLinux(); lc != nil {
|
|
||||||
// Apply Cgroup options.
|
|
||||||
// TODO: Check if this works with per-pod cgroups.
|
|
||||||
// TODO: we need to pass the cgroup in syntax expected by cgroup driver but shim does not use docker info yet...
|
|
||||||
hc.CgroupParent = lc.GetCgroupParent()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply Linux-specific options if applicable.
|
// Apply Linux-specific options if applicable.
|
||||||
if lc := config.GetLinux(); lc != nil {
|
if lc := config.GetLinux(); lc != nil {
|
||||||
// Apply resource options.
|
// Apply resource options.
|
||||||
@ -154,6 +146,14 @@ func (ds *dockerService) CreateContainer(podSandboxID string, config *runtimeapi
|
|||||||
applyContainerSecurityContext(lc, podSandboxID, createConfig.Config, hc)
|
applyContainerSecurityContext(lc, podSandboxID, createConfig.Config, hc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply cgroupsParent derived from the sandbox config.
|
||||||
|
if lc := sandboxConfig.GetLinux(); lc != nil {
|
||||||
|
// Apply Cgroup options.
|
||||||
|
// TODO: Check if this works with per-pod cgroups.
|
||||||
|
// TODO: we need to pass the cgroup in syntax expected by cgroup driver but shim does not use docker info yet...
|
||||||
|
hc.CgroupParent = lc.GetCgroupParent()
|
||||||
|
}
|
||||||
|
|
||||||
// Set devices for container.
|
// Set devices for container.
|
||||||
devices := make([]dockercontainer.DeviceMapping, len(config.Devices))
|
devices := make([]dockercontainer.DeviceMapping, len(config.Devices))
|
||||||
for i, device := range config.Devices {
|
for i, device := range config.Devices {
|
||||||
|
Loading…
Reference in New Issue
Block a user