From 9ab5ad73358ea959a99995a4de790a2cd17e8041 Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:55:04 -0500 Subject: [PATCH] fix(status): set correct status after checkin --- cmd/vela-worker/register.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index e1e5098d..ac0deabc 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -72,8 +72,11 @@ func (w *Worker) checkIn(config *api.Worker) (bool, string, error) { return false, "", fmt.Errorf("unable to refresh auth for worker %s on the server: %w", config.GetHostname(), err) } + + status := w.getWorkerStatusFromConfig(config) + // update worker status to Idle when checkIn is successful. - w.updateWorkerStatus(config, constants.WorkerStatusIdle) + w.updateWorkerStatus(config, status) break } @@ -112,8 +115,10 @@ func (w *Worker) queueCheckIn(ctx context.Context, registryWorker *api.Worker) ( return false, pErr } + status := w.getWorkerStatusFromConfig(registryWorker) + // update worker status to Idle when setup and ping are good. - w.updateWorkerStatus(registryWorker, constants.WorkerStatusIdle) + w.updateWorkerStatus(registryWorker, status) return true, nil }