mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
skip WaitForAttachAndMount for terminated pods in syncPod
This commit is contained in:
parent
2c624e590f
commit
265db191f1
@ -1542,12 +1542,15 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Volume manager will not mount volumes for terminated pods
|
||||||
|
if !kl.podIsTerminated(pod) {
|
||||||
// Wait for volumes to attach/mount
|
// Wait for volumes to attach/mount
|
||||||
if err := kl.volumeManager.WaitForAttachAndMount(pod); err != nil {
|
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)
|
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)
|
glog.Errorf("Unable to mount volumes for pod %q: %v; skipping pod", format.Pod(pod), err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch the pull secrets for the pod
|
// Fetch the pull secrets for the pod
|
||||||
pullSecrets := kl.getPullSecretsForPod(pod)
|
pullSecrets := kl.getPullSecretsForPod(pod)
|
||||||
|
Loading…
Reference in New Issue
Block a user