Skip to content

Commit 964d7a1

Browse files
authored
fix(patch/v25.2): apply worker status fix (#613)
1 parent 1632331 commit 964d7a1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmd/vela-worker/register.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ func (w *Worker) checkIn(config *api.Worker) (bool, string, error) {
7373

7474
return false, "", fmt.Errorf("unable to refresh auth for worker %s on the server: %w", config.GetHostname(), err)
7575
}
76+
77+
status := w.getWorkerStatusFromConfig(config)
78+
7679
// update worker status to Idle when checkIn is successful.
77-
w.updateWorkerStatus(config, constants.WorkerStatusIdle)
80+
w.updateWorkerStatus(config, status)
7881

7982
break
8083
}
@@ -113,8 +116,10 @@ func (w *Worker) queueCheckIn(ctx context.Context, registryWorker *api.Worker) (
113116
return false, pErr
114117
}
115118

119+
status := w.getWorkerStatusFromConfig(registryWorker)
120+
116121
// update worker status to Idle when setup and ping are good.
117-
w.updateWorkerStatus(registryWorker, constants.WorkerStatusIdle)
122+
w.updateWorkerStatus(registryWorker, status)
118123

119124
return true, nil
120125
}

0 commit comments

Comments
 (0)