Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(status): set correct status after checkin #611

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading