Skip to content

Commit

Permalink
Observer StatefulSet first
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed Sep 13, 2024
1 parent 3af34aa commit 36a0498
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions controllers/function_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions controllers/sink_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions controllers/source_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36a0498

Please sign in to comment.