mirror of
https://github.com/containers/podman.git
synced 2026-02-05 15:45:08 +01:00
Merge pull request #26174 from fpoirotte/kube_cpuset_cgroup
Support --cpuset-cpus and --cpuset-mems in podman kube play
This commit is contained in:
@@ -393,6 +393,28 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
|
||||
}
|
||||
}
|
||||
|
||||
if cpuset, ok := annotations[define.CpusetAnnotation+"/"+opts.Container.Name]; ok {
|
||||
s.Annotations[define.CpusetAnnotation] = cpuset
|
||||
if s.ResourceLimits == nil {
|
||||
s.ResourceLimits = &spec.LinuxResources{}
|
||||
}
|
||||
if s.ResourceLimits.CPU == nil {
|
||||
s.ResourceLimits.CPU = &spec.LinuxCPU{}
|
||||
}
|
||||
s.ResourceLimits.CPU.Cpus = cpuset
|
||||
}
|
||||
|
||||
if memNodes, ok := annotations[define.MemoryNodesAnnotation+"/"+opts.Container.Name]; ok {
|
||||
s.Annotations[define.MemoryNodesAnnotation] = memNodes
|
||||
if s.ResourceLimits == nil {
|
||||
s.ResourceLimits = &spec.LinuxResources{}
|
||||
}
|
||||
if s.ResourceLimits.CPU == nil {
|
||||
s.ResourceLimits.CPU = &spec.LinuxCPU{}
|
||||
}
|
||||
s.ResourceLimits.CPU.Mems = memNodes
|
||||
}
|
||||
|
||||
if label, ok := opts.Annotations[define.InspectAnnotationLabel+"/"+opts.Container.Name]; ok {
|
||||
if label == "nested" {
|
||||
s.ContainerSecurityConfig.LabelNested = &localTrue
|
||||
|
||||
Reference in New Issue
Block a user