From 51bf930c03400bbe165a1eaff0458a23ad9c76a6 Mon Sep 17 00:00:00 2001 From: Antonino Fugazzotto Date: Thu, 22 Aug 2024 14:39:44 -0700 Subject: [PATCH] fix: check if spec needs to be updated. Signed-off-by: Antonino Fugazzotto --- internal/controller/isbservicerollout_controller.go | 2 +- internal/controller/pipelinerollout_controller.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controller/isbservicerollout_controller.go b/internal/controller/isbservicerollout_controller.go index 5c89a1a2..e91e9fed 100644 --- a/internal/controller/isbservicerollout_controller.go +++ b/internal/controller/isbservicerollout_controller.go @@ -294,7 +294,7 @@ func (r *ISBServiceRolloutReconciler) processExistingISBService(ctx context.Cont r.customMetrics.ReconciliationDuration.WithLabelValues(ControllerISBSVCRollout, "update").Observe(time.Since(syncStartTime).Seconds()) return nil }) - } else { + } else if isbServiceNeedsUpdating { // update ISBService err = r.updateISBService(ctx, isbServiceRollout, newISBServiceDef) if err != nil { diff --git a/internal/controller/pipelinerollout_controller.go b/internal/controller/pipelinerollout_controller.go index 77c53a5c..39490fc3 100644 --- a/internal/controller/pipelinerollout_controller.go +++ b/internal/controller/pipelinerollout_controller.go @@ -428,7 +428,7 @@ func (r *PipelineRolloutReconciler) processExistingPipeline(ctx context.Context, if err = r.processExistingPipelineWithoutDataLoss(ctx, pipelineRollout, existingPipelineDef, newPipelineDef, pipelineNeedsToUpdate); err != nil { return err } - } else { + } else if pipelineNeedsToUpdate { if err := updatePipelineSpec(ctx, r.restConfig, newPipelineDef); err != nil { return err }