Merge pull request #126043 from carlory/automated-cherry-pick-of-#125767-upstream-release-1.30

Automated cherry pick of #125767: Fix pv reclaim failed due to its phase is wrongly updated to
This commit is contained in:
Kubernetes Prow Robot 2024-07-12 07:05:16 -07:00 committed by GitHub
commit c6c2a46727
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1958,16 +1958,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