mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #23078 from swagiaal/pv-recycle-race
Auto commit by PR queue bot
This commit is contained in:
commit
a577e16d8d
@ -238,7 +238,7 @@ func syncVolume(volumeIndex *persistentVolumeOrderedIndex, binderClient binderCl
|
|||||||
|
|
||||||
if volume.Spec.ClaimRef != nil {
|
if volume.Spec.ClaimRef != nil {
|
||||||
claim, err := binderClient.GetPersistentVolumeClaim(volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name)
|
claim, err := binderClient.GetPersistentVolumeClaim(volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name)
|
||||||
if errors.IsNotFound(err) {
|
if errors.IsNotFound(err) || (claim != nil && claim.UID != volume.Spec.ClaimRef.UID) {
|
||||||
if volume.Spec.PersistentVolumeReclaimPolicy == api.PersistentVolumeReclaimRecycle {
|
if volume.Spec.PersistentVolumeReclaimPolicy == api.PersistentVolumeReclaimRecycle {
|
||||||
// Pending volumes that have a ClaimRef where the claim is missing were recently recycled.
|
// Pending volumes that have a ClaimRef where the claim is missing were recently recycled.
|
||||||
// The Recycler set the phase to VolumePending to start the volume at the beginning of this lifecycle.
|
// The Recycler set the phase to VolumePending to start the volume at the beginning of this lifecycle.
|
||||||
|
Loading…
Reference in New Issue
Block a user