UPSTREAM: 49724: skip WaitForAttachAndMount for terminated pods in syncPod
@@ -1569,12 +1569,15 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
return err
}
+ // Volume manager will not mount volumes for terminated pods
+ if !kl.podIsTerminated(pod) {
// Wait for volumes to attach/mount
if err := kl.volumeManager.WaitForAttachAndMount(pod); err != nil {
kl.recorder.Eventf(pod, v1.EventTypeWarning, events.FailedMountVolume, "Unable to mount volumes for pod %q: %v", format.Pod(pod), err)
glog.Errorf("Unable to mount volumes for pod %q: %v; skipping pod", format.Pod(pod), err)
return err
}
+ }
// Fetch the pull secrets for the pod
pullSecrets := kl.getPullSecretsForPod(pod)
