DRA: get rid of unneeded loops over pod containers

This commit is contained in:
Ed Bartosh 2023-03-15 09:41:30 +02:00
parent 37937bb227
commit 1aeec10efb

View File

@ -66,9 +66,6 @@ func NewManagerImpl(kubeClient clientset.Interface, stateFileDirectory string) (
// for each new resource requirement, process their responses and update the cached
// containerResources on success.
func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error {
// Process resources for each resource claim referenced by container
for _, container := range append(pod.Spec.InitContainers, pod.Spec.Containers...) {
for range container.Resources.Claims {
for i := range pod.Spec.ResourceClaims {
claimName := resourceclaim.Name(pod, &pod.Spec.ResourceClaims[i])
klog.V(3).InfoS("Processing resource", "claim", claimName, "pod", pod.Name)
@ -173,8 +170,6 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error {
}
}
}
}
}
// Checkpoint to capture all of the previous addPodReference() calls.
err := m.cache.syncToCheckpoint()
if err != nil {