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):
 | 
								case err != nil && !errors.IsNotFound(err):
 | 
				
			||||||
				return fmt.Errorf("Error getting PersistentVolumeClaim[%s/%s]: %v", volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name, 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):
 | 
								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 {
 | 
									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.
 | 
				
			||||||
@@ -255,6 +256,7 @@ func syncVolume(volumeIndex *persistentVolumeOrderedIndex, binderClient binderCl
 | 
				
			|||||||
					if !ok {
 | 
										if !ok {
 | 
				
			||||||
						return fmt.Errorf("Unexpected pv cast error : %v\n", volumeClone)
 | 
											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
 | 
										volumeClone.Spec.ClaimRef = nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					if updatedVolume, err := binderClient.UpdatePersistentVolume(volumeClone); err != nil {
 | 
										if updatedVolume, err := binderClient.UpdatePersistentVolume(volumeClone); err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user