From 36a049874f4b13c5d3fc3ce1143e33a616b887bf Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Fri, 13 Sep 2024 11:01:33 +0800 Subject: [PATCH] Observer StatefulSet first --- controllers/function_controller.go | 8 ++++---- controllers/sink_controller.go | 8 ++++---- controllers/source_controller.go | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/controllers/function_controller.go b/controllers/function_controller.go index 82db9c3f..0c24c7ec 100644 --- a/controllers/function_controller.go +++ b/controllers/function_controller.go @@ -101,15 +101,15 @@ func (r *FunctionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c isNewGeneration := r.checkIfFunctionGenerationsIsIncreased(function) + err = r.ObserveFunctionStatefulSet(ctx, function) + if err != nil { + return reconcile.Result{}, err + } // skip reconcile if pauseRollout is set to true and the generation is not increased if spec.IsPauseRollout(function) && !isNewGeneration { return ctrl.Result{}, nil } - err = r.ObserveFunctionStatefulSet(ctx, function) - if err != nil { - return reconcile.Result{}, err - } err = r.ObserveFunctionService(ctx, function) if err != nil { return reconcile.Result{}, err diff --git a/controllers/sink_controller.go b/controllers/sink_controller.go index 5b3a1d74..d9775b10 100644 --- a/controllers/sink_controller.go +++ b/controllers/sink_controller.go @@ -100,15 +100,15 @@ func (r *SinkReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. isNewGeneration := r.checkIfSinkGenerationsIsIncreased(sink) + err = r.ObserveSinkStatefulSet(ctx, sink) + if err != nil { + return reconcile.Result{}, err + } // skip reconcile if pauseRollout is set to true and the generation is not increased if spec.IsPauseRollout(sink) && !isNewGeneration { return ctrl.Result{}, nil } - err = r.ObserveSinkStatefulSet(ctx, sink) - if err != nil { - return reconcile.Result{}, err - } err = r.ObserveSinkService(ctx, sink) if err != nil { return reconcile.Result{}, err diff --git a/controllers/source_controller.go b/controllers/source_controller.go index a5ae0141..5116abfb 100644 --- a/controllers/source_controller.go +++ b/controllers/source_controller.go @@ -100,15 +100,15 @@ func (r *SourceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr isNewGeneration := r.checkIfSourceGenerationsIsIncreased(source) + err = r.ObserveSourceStatefulSet(ctx, source) + if err != nil { + return reconcile.Result{}, err + } // skip reconcile if pauseRollout is set to true and the generation is not increased if spec.IsPauseRollout(source) && !isNewGeneration { return ctrl.Result{}, nil } - err = r.ObserveSourceStatefulSet(ctx, source) - if err != nil { - return reconcile.Result{}, err - } err = r.ObserveSourceService(ctx, source) if err != nil { return reconcile.Result{}, err