Skip to content

Commit b1873f6

Browse files
committed
Schedule requeue when updateStatus fails in K0sControlPlane defer
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
1 parent 76582d3 commit b1873f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/controller/controlplane/k0s_controlplane_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ func (c *K0sController) Reconcile(ctx context.Context, req ctrl.Request) (res ct
179179
if derr != nil {
180180
if !errors.Is(derr, errUpgradeNotCompleted) {
181181
log.Error(derr, "Failed to update status")
182+
// Schedule a requeue so the controller retries status update
183+
if res.IsZero() {
184+
res = ctrl.Result{RequeueAfter: 20 * time.Second, Requeue: true}
185+
}
182186
return
183187
}
184188

0 commit comments

Comments
 (0)