Skip to content

Commit

Permalink
fix: check if runner name is empty and return
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
  • Loading branch information
bavarianbidi committed Jun 5, 2024
1 parent dc74c45 commit b4e7dea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions runner/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ func (r *basePoolManager) HandleWorkflowJob(job params.WorkflowJob) error {
return errors.Wrap(err, "converting job to params")
}

// If job was not assigned to a runner, we can ignore it.
if jobParams.RunnerName == "" {
slog.InfoContext(
r.ctx, "job never got assigned to a runner, ignoring")
return nil
}

// update instance workload state.
if _, err := r.setInstanceRunnerStatus(jobParams.RunnerName, params.RunnerTerminated); err != nil {
if errors.Is(err, runnerErrors.ErrNotFound) {
Expand Down

0 comments on commit b4e7dea

Please sign in to comment.