runtime-rs: respect Linux cgroup parent and resources from the sandbox API

Author: xujihui1985Created Sep 27, 2026Updated Sep 27, 2026
Labelsenhancementneeds-review

Problem

Sandbox creation through the sandbox API does not honor LinuxPodSandboxConfig.cgroup_parent or propagate its resource settings into the annotations consumed by InitialSizeManager.

As a result, the sandbox can use the fallback cgroup path and initial VM sizing may not reflect the resources supplied by the caller.

Using the supplied parent also requires handling partially initialized cgroup v1 hierarchies. A kubelet-created parent may exist under CPU and memory controllers but lack a devices directory, causing process attachment to fail.

Expected behavior

  • Use the supplied cgroup parent directly when nonempty.
  • Ensure missing cgroup v1 filesystem-controller directories exist before attaching processes.
  • Populate the existing sizing annotations from Linux resource settings.
  • Preserve existing behavior when the parent or resources are absent.

Source: kata-containers/kata-containers