fix: 119921

This commit is contained in:
cvvz 2023-08-13 15:52:25 +08:00
parent 6e0cb243d5
commit e40d00cf53

View File

@ -83,7 +83,6 @@ func (rc *reconciler) syncStates(kubeletPodDir string) {
if cachedInfo, ok := volumesNeedUpdate[reconstructedVolume.volumeName]; ok {
gvl = cachedInfo
}
gvl.addPodVolume(reconstructedVolume)
if volumeInDSW {
// Some pod needs the volume. And it exists on disk. Some previous
// kubelet must have created the directory, therefore it must have
@ -95,6 +94,7 @@ func (rc *reconciler) syncStates(kubeletPodDir string) {
klog.V(4).InfoS("Volume exists in desired state, marking as InUse", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName)
continue
}
gvl.addPodVolume(reconstructedVolume)
// There is no pod that uses the volume.
if rc.operationExecutor.IsOperationPending(reconstructedVolume.volumeName, nestedpendingoperations.EmptyUniquePodName, nestedpendingoperations.EmptyNodeName) {
klog.InfoS("Volume is in pending operation, skip cleaning up mounts")