Merge pull request #8974 from yaoyinnan/5240/fix/cgroup-parallel

runtime: add SingleContainer when obtaining OCI Spec
This commit is contained in:
Alex Lyn
2024-02-01 11:43:02 +08:00
committed by GitHub

View File

@@ -2576,11 +2576,12 @@ func (s *Sandbox) GetPatchedOCISpec() *specs.Spec {
return nil return nil
} }
// get the container associated with the PodSandbox annotation. In Kubernetes, this // Get the container associated with the PodSandbox annotation.
// represents the pause container. In Docker, this is the container. // In Kubernetes, this represents the pause container.
// On Linux, we derive the group path from this container. // In CRI-compliant runtimes like Containerd, this is the container.
// On Linux, we derive the cgroup path from this container.
for _, cConfig := range s.config.Containers { for _, cConfig := range s.config.Containers {
if cConfig.Annotations[annotations.ContainerTypeKey] == string(PodSandbox) { if ContainerType(cConfig.Annotations[annotations.ContainerTypeKey]).IsSandbox() {
return cConfig.CustomSpec return cConfig.CustomSpec
} }
} }