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:
		@@ -66,9 +66,6 @@ func NewManagerImpl(kubeClient clientset.Interface, stateFileDirectory string) (
 | 
				
			|||||||
// for each new resource requirement, process their responses and update the cached
 | 
					// for each new resource requirement, process their responses and update the cached
 | 
				
			||||||
// containerResources on success.
 | 
					// containerResources on success.
 | 
				
			||||||
func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error {
 | 
					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 {
 | 
						for i := range pod.Spec.ResourceClaims {
 | 
				
			||||||
		claimName := resourceclaim.Name(pod, &pod.Spec.ResourceClaims[i])
 | 
							claimName := resourceclaim.Name(pod, &pod.Spec.ResourceClaims[i])
 | 
				
			||||||
		klog.V(3).InfoS("Processing resource", "claim", claimName, "pod", pod.Name)
 | 
							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.
 | 
						// Checkpoint to capture all of the previous addPodReference() calls.
 | 
				
			||||||
	err := m.cache.syncToCheckpoint()
 | 
						err := m.cache.syncToCheckpoint()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user