mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
Use only enqueuePod to add pods to the controller queue
enqueuePod already creates the right key for a pod, it's better to reuse it than copy the code around.
This commit is contained in:
@@ -295,11 +295,7 @@ func (c *Controller) enqueueAllPodsForPVC(logger klog.Logger, namespace, name st
|
||||
return
|
||||
}
|
||||
for _, obj := range objs {
|
||||
podRef, err := cache.DeletionHandlingObjectToName(obj)
|
||||
if err != nil {
|
||||
utilruntime.HandleError(fmt.Errorf("couldn't get key for pod %#v: %w", obj, err))
|
||||
}
|
||||
c.queue.Add(podRef)
|
||||
c.enqueuePod(logger, obj)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user