Fix pv reclaim failed due to its phase is wrongly updated to the Failed state by kcm

This commit is contained in:
carlory 2024-06-28 01:25:45 +08:00
parent 41f21823f5
commit cd2c8cb5fd

View File

@ -1935,16 +1935,14 @@ func (ctrl *PersistentVolumeController) findDeletablePlugin(volume *v1.Persisten
} }
} }
if utilfeature.DefaultFeatureGate.Enabled(features.HonorPVReclaimPolicy) { if metav1.HasAnnotation(volume.ObjectMeta, storagehelpers.AnnMigratedTo) {
if metav1.HasAnnotation(volume.ObjectMeta, storagehelpers.AnnMigratedTo) { // CSI migration scenario - do not depend on in-tree plugin
// CSI migration scenario - do not depend on in-tree plugin return nil, nil
return nil, nil }
}
if volume.Spec.CSI != nil { if volume.Spec.CSI != nil {
// CSI volume source scenario - external provisioner is requested // CSI volume source scenario - external provisioner is requested
return nil, nil return nil, nil
}
} }
// The plugin that provisioned the volume was not found or the volume // The plugin that provisioned the volume was not found or the volume