@@ -72,15 +72,16 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
7272 return ctrl.Result {}, fmt .Errorf ("failed to create or patch CloudProfile: %w" , err )
7373 }
7474 log .Info ("applied cloud profile" , "op" , op )
75-
76- if err := r .patchStatusAndCondition (ctx , & mcp , v1alpha1 .SucceededReconcileStatus , metav1.Condition {
77- Type : CloudProfileAppliedConditionType ,
78- Status : metav1 .ConditionTrue ,
79- ObservedGeneration : mcp .Generation ,
80- Reason : "Applied" ,
81- Message : "Generated CloudProfile applied successfully" ,
82- }); err != nil {
83- return ctrl.Result {}, fmt .Errorf ("failed to patch ManagedCloudProfile status: %w" , err )
75+ if op != controllerutil .OperationResultNone {
76+ if err := r .patchStatusAndCondition (ctx , & mcp , v1alpha1 .SucceededReconcileStatus , metav1.Condition {
77+ Type : CloudProfileAppliedConditionType ,
78+ Status : metav1 .ConditionTrue ,
79+ ObservedGeneration : mcp .Generation ,
80+ Reason : "Applied" ,
81+ Message : "Generated CloudProfile applied successfully" ,
82+ }); err != nil {
83+ return ctrl.Result {}, fmt .Errorf ("failed to patch ManagedCloudProfile status: %w" , err )
84+ }
8485 }
8586 log .Info ("reconciled ManagedCloudProfile" )
8687 return ctrl.Result {RequeueAfter : 5 * time .Minute }, nil
0 commit comments