Skip to content

Commit

Permalink
rollouts: reconcile fleet rollouts periodically (#3841)
Browse files Browse the repository at this point in the history
* rollouts: reconcile fleet rollouts periodically
  • Loading branch information
droot committed Feb 23, 2023
1 parent 7bc1011 commit e3ff258
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rollouts/controllers/rollout_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"sort"
"strings"
"sync"
"time"

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

return ctrl.Result{}, nil
}
Expand Down

0 comments on commit e3ff258

Please sign in to comment.