File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,10 @@ func (r *resourceReconciler) patchResourceMetadataAndSpec(
340340	}
341341
342342	rlog .Enter ("kc.Patch (metadata + spec)" )
343+ 	// It is necessary to use `DeepCopyObject` versions of `latest` when calling 
344+ 	// `Patch` as this method overrides all values as merged from `desired`. 
345+ 	// This may affect `latest` in later execution, as otherwise this would set 
346+ 	//`desired` == `latest` after calling this method. 
343347	err  =  r .kc .Patch (
344348		ctx ,
345349		latest .RuntimeObject ().DeepCopyObject (),
@@ -373,6 +377,10 @@ func (r *resourceReconciler) patchResourceStatus(
373377		return  nil 
374378	}
375379	rlog .Enter ("kc.Patch (status)" )
380+ 	// It is necessary to use `DeepCopyObject` versions of `latest` when calling 
381+ 	// `Patch` as this method overrides all values as merged from `desired`. 
382+ 	// This may affect `latest` in later execution, as otherwise this would set 
383+ 	//`desired` == `latest` after calling this method. 
376384	err  =  r .kc .Status ().Patch (
377385		ctx ,
378386		latest .RuntimeObject ().DeepCopyObject (),
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments