mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Add loging to the recently recycled PV section
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user