mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-11-06 05:17:08 +00:00
Iterating over containers using `append(pod.Spec.Containers, pod.Spec.InitContainers...)` allocates a new backing slice and copies large Container structs by value, which adds unnecessary heap allocations and GC overhead. Switch callers across kubelet, scheduler plugins, and controllers to iterate in-place via podutil.ContainerIter.