diff --git a/controller/kubernetes_pod_controller.go b/controller/kubernetes_pod_controller.go index 03010857de..25e5c26288 100644 --- a/controller/kubernetes_pod_controller.go +++ b/controller/kubernetes_pod_controller.go @@ -341,7 +341,7 @@ func (kc *KubernetesPodController) handlePodDeletionIfVolumeRequestRemount(pod * if podStartTime.Before(remountRequestedAt) { if !timeNow.After(remountRequestedAt.Add(remountRequestDelayDuration)) { kc.logger.Infof("Current time is not %v seconds after request remount, requeue the pod %v to handle it later", remountRequestDelayDuration.Seconds(), pod.GetName()) - kc.enqueuePod(pod) + kc.enqueuePodAfter(pod, remountRequestDelayDuration) return nil } @@ -476,12 +476,12 @@ func (kc *KubernetesPodController) getAssociatedVolumes(pod *corev1.Pod) ([]*lon return volumeList, nil } -func (kc *KubernetesPodController) enqueuePod(obj interface{}) { +func (kc *KubernetesPodController) enqueuePodAfter(obj interface{}, delay time.Duration) { key, err := controller.KeyFunc(obj) if err != nil { utilruntime.HandleError(fmt.Errorf("couldn't get key for object %#v: %v", obj, err)) return } - kc.queue.Add(key) + kc.queue.AddAfter(key, delay) }