Skip to content

Commit e3ff258

Browse files
authored
rollouts: reconcile fleet rollouts periodically (#3841)
* rollouts: reconcile fleet rollouts periodically
1 parent 7bc1011 commit e3ff258

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

rollouts/controllers/rollout_controller.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"sort"
2626
"strings"
2727
"sync"
28+
"time"
2829

2930
apierrors "k8s.io/apimachinery/pkg/api/errors"
3031
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -156,6 +157,18 @@ func (r *RolloutReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
156157
if err != nil {
157158
return ctrl.Result{}, err
158159
}
160+
if rollout.Spec.Clusters.SourceType == gitopsv1alpha1.GCPFleet &&
161+
(rollout.Status.Overall == "Completed" || rollout.Status.Overall == "Stalled") {
162+
// TODO (droot): The rollouts in completed/stalled state will not be reconciled
163+
// whenever fleet memberships change, so scheduling a periodic reconcile
164+
// until we fix https://github.com/GoogleContainerTools/kpt/issues/3835
165+
// This can be safely removed once we start monitoring fleet changes.
166+
// Note: we watch containercluster types, so this problem doesn't exist for the
167+
// KCC clusters.
168+
return ctrl.Result{
169+
RequeueAfter: 30 * time.Second,
170+
}, nil
171+
}
159172

160173
return ctrl.Result{}, nil
161174
}

0 commit comments

Comments
 (0)