Skip to content

Commit fe32846

Browse files
committed
Poll for assemblage updates in the downstream
The ProxyAssemblage controller does not have the opportunity to be notified of changes in a downstream cluster (or at least, this would be tricky to arrange, especially at scale), so it won't in general see when its Assemblage counterpart changes status. A dumb but effective way to make sure updates are seen is to simply requeue each ProxyAssemblage to be re-examined after a small interval. This will be OK at moderate scale (I would guess O(100) clusters), since more worker threads can be configured to cope with polling. Larger scales may need a less brute force approach to be figured out. Signed-off-by: Michael Bridgen <mikeb@squaremobius.net>
1 parent 6df3595 commit fe32846

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

module/controllers/proxyassemblage_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"context"
99
"fmt"
1010
"strings"
11+
"time"
1112

1213
"k8s.io/apimachinery/pkg/runtime"
1314
"sigs.k8s.io/cluster-api/controllers/remote"
@@ -20,6 +21,8 @@ import (
2021
fleetv1 "github.com/squaremo/fleeet/module/api/v1alpha1"
2122
)
2223

24+
const proxyPollInterval = 20 * time.Second
25+
2326
// ProxyAssemblageReconciler reconciles a ProxyAssemblage object
2427
type ProxyAssemblageReconciler struct {
2528
client.Client
@@ -84,7 +87,8 @@ func (r *ProxyAssemblageReconciler) Reconcile(ctx context.Context, req ctrl.Requ
8487
return ctrl.Result{}, err
8588
}
8689

87-
return ctrl.Result{}, nil
90+
// We don't get notified of things happening in the downstream cluster; so, requeue to poll instead.
91+
return ctrl.Result{RequeueAfter: proxyPollInterval}, nil
8892
}
8993

9094
// SetupWithManager sets up the controller with the Manager.

0 commit comments

Comments
 (0)