Merge pull request #116560 from bart0sh/PR107-DRA-get-rid-of-extra-loops

DRA: get rid of unneeded loops over pod containers
This commit is contained in:
Kubernetes Prow Robot 2023-04-11 21:16:50 -07:00 committed by GitHub
commit 006ad0576e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {