mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	add comments for switch of syncUnboundClaim
This commit is contained in:
		@@ -346,7 +346,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(ctx context.Context, cl
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		if volume == nil {
 | 
							if volume == nil {
 | 
				
			||||||
			logger.V(4).Info("Synchronizing unbound PersistentVolumeClaim, no volume found", "PVC", klog.KObj(claim))
 | 
								logger.V(4).Info("Synchronizing unbound PersistentVolumeClaim, no volume found", "PVC", klog.KObj(claim))
 | 
				
			||||||
			// No PV could be found
 | 
								// No PV could be found. Try to provision one if possible.
 | 
				
			||||||
			// OBSERVATION: pvc is "Pending", will retry
 | 
								// OBSERVATION: pvc is "Pending", will retry
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			logger.V(4).Info("Attempting to assign storage class to unbound PersistentVolumeClaim", "PVC", klog.KObj(claim))
 | 
								logger.V(4).Info("Attempting to assign storage class to unbound PersistentVolumeClaim", "PVC", klog.KObj(claim))
 | 
				
			||||||
@@ -363,10 +363,15 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(ctx context.Context, cl
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			switch {
 | 
								switch {
 | 
				
			||||||
			case delayBinding && !storagehelpers.IsDelayBindingProvisioning(claim):
 | 
								case delayBinding && !storagehelpers.IsDelayBindingProvisioning(claim):
 | 
				
			||||||
 | 
									// Scheduler does not observe any pod using this claim.
 | 
				
			||||||
				if err = ctrl.emitEventForUnboundDelayBindingClaim(claim); err != nil {
 | 
									if err = ctrl.emitEventForUnboundDelayBindingClaim(claim); err != nil {
 | 
				
			||||||
					return err
 | 
										return err
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			case storagehelpers.GetPersistentVolumeClaimClass(claim) != "":
 | 
								case storagehelpers.GetPersistentVolumeClaimClass(claim) != "":
 | 
				
			||||||
 | 
									// The provisionClaim function may start a new asynchronous operation to provision a volume,
 | 
				
			||||||
 | 
									// or the operation is already running. The claim will be updated in the asynchronous operation,
 | 
				
			||||||
 | 
									// so the branch should be returned directly and the bind operation is expected to continue in
 | 
				
			||||||
 | 
									// the next sync loop.
 | 
				
			||||||
				if err = ctrl.provisionClaim(ctx, claim); err != nil {
 | 
									if err = ctrl.provisionClaim(ctx, claim); err != nil {
 | 
				
			||||||
					return err
 | 
										return err
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user