Merge pull request #23449 from swagiaal/pv-recycle-race-logging

Add loging to the recently recycled PV section
This commit is contained in:
Jeff Lowdermilk 2016-04-08 13:30:23 -07:00
commit c3dac2d18b

View File

@ -243,6 +243,7 @@ func syncVolume(volumeIndex *persistentVolumeOrderedIndex, binderClient binderCl
case err != nil && !errors.IsNotFound(err):
return fmt.Errorf("Error getting PersistentVolumeClaim[%s/%s]: %v", volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name, err)
case errors.IsNotFound(err) || (claim != nil && claim.UID != volume.Spec.ClaimRef.UID):
glog.V(5).Infof("PersistentVolume[%s] has a claim ref to a claim which does not exist", volume.Name)
if volume.Spec.PersistentVolumeReclaimPolicy == api.PersistentVolumeReclaimRecycle {
// 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.
@ -255,6 +256,7 @@ func syncVolume(volumeIndex *persistentVolumeOrderedIndex, binderClient binderCl
if !ok {
return fmt.Errorf("Unexpected pv cast error : %v\n", volumeClone)
}
glog.V(5).Infof("PersistentVolume[%s] is recently recycled; remove claimRef.", volume.Name)
volumeClone.Spec.ClaimRef = nil
if updatedVolume, err := binderClient.UpdatePersistentVolume(volumeClone); err != nil {