cmd/k8s-operator: remove unnecessary timed requeue.

Previously, we had to do blind timed requeues while waiting for
the tailscale hostname, because we looked up the hostname through
the API. But now the proxy container image writes back its hostname
to the k8s secret, so we get an event-triggered reconcile automatically
when the time is right.

Updates #502

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2022-12-13 16:04:35 -08:00 committed by Dave Anderson
parent d857fd00b3
commit 835a73cc1f
2 changed files with 3 additions and 3 deletions

View File

@ -380,7 +380,7 @@ func (a *ServiceReconciler) Reconcile(ctx context.Context, req reconcile.Request
if err := a.Status().Update(ctx, svc); err != nil {
return reconcile.Result{}, fmt.Errorf("failed to update service status: %w", err)
}
return reconcile.Result{RequeueAfter: 10 * time.Second}, nil
return reconcile.Result{}, nil
}
logger.Debugf("setting ingress hostname to %q", tsHost)

View File

@ -60,7 +60,7 @@ func TestLoadBalancerClass(t *testing.T) {
},
})
expectRequeue(t, sr, "default", "test")
expectReconciled(t, sr, "default", "test")
fullName, shortName := findGenName(t, fc, "default", "test")
@ -394,7 +394,7 @@ func TestLBIntoAnnotation(t *testing.T) {
},
})
expectRequeue(t, sr, "default", "test")
expectReconciled(t, sr, "default", "test")
fullName, shortName := findGenName(t, fc, "default", "test")