Skip to content

Commit

Permalink
fix(patch/v25.2): apply worker status fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Nov 1, 2024
1 parent 1632331 commit 69a0667
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 @@ -73,8 +73,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 @@ -113,8 +116,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 69a0667

Please sign in to comment.