From e16765f108aa89f40497a9796ec95f36846fbb53 Mon Sep 17 00:00:00 2001 From: zoumo Date: Fri, 1 Aug 2025 22:47:20 +0800 Subject: [PATCH] fix: stop syncing complited rolloutRun --- pkg/controllers/rolloutrun/rolloutrun_controller.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/controllers/rolloutrun/rolloutrun_controller.go b/pkg/controllers/rolloutrun/rolloutrun_controller.go index 2d3ae3f..7152aea 100644 --- a/pkg/controllers/rolloutrun/rolloutrun_controller.go +++ b/pkg/controllers/rolloutrun/rolloutrun_controller.go @@ -108,6 +108,7 @@ func (r *RolloutRunReconciler) Reconcile(ctx context.Context, req ctrl.Request) err := r.Client.Get(clusterinfo.WithCluster(ctx, clusterinfo.Fed), req.NamespacedName, obj) if err != nil { if errors.IsNotFound(err) { + r.rvExpectation.DeleteExpectations(req.String()) return reconcile.Result{}, nil } return reconcile.Result{}, err @@ -122,6 +123,11 @@ func (r *RolloutRunReconciler) Reconcile(ctx context.Context, req ctrl.Request) return ctrl.Result{}, nil } + if obj.IsCompleted() { + // rolloutRun is completed, skip syncing + return reconcile.Result{}, nil + } + newStatus := obj.Status.DeepCopy() accessor, workloads, canaryWorkloads, err := r.findWorkloadsCrossCluster(ctx, obj)