Skip to content

Commit

Permalink
fix(status): set correct status after checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3r committed Oct 23, 2024
1 parent 3db6801 commit 9ab5ad7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/vela-worker/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 9ab5ad7

Please sign in to comment.