Skip to content

Commit

Permalink
Check PodSchedulingContext for nil in `appendLabelsFromJobSchedul…
Browse files Browse the repository at this point in the history
…ingContext` (#61) (#3376)

Co-authored-by: Noah Held <Noah.Held@gresearch.co.uk>
  • Loading branch information
severinson and Noah Held committed Feb 6, 2024
1 parent 118cde5 commit cb78fab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/scheduler/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ func appendLabelsFromJobSchedulingContext(labels []string, jctx *schedulercontex
executor, nodeName := executorAndNodeNameFromRun(job.LatestRun())
labels = append(labels, job.GetQueue())
labels = append(labels, executor)
labels = append(labels, jctx.PodSchedulingContext.WellKnownNodeTypeName)
wellKnownNodeType := ""
if pctx := jctx.PodSchedulingContext; pctx != nil {
wellKnownNodeType = pctx.WellKnownNodeTypeName
}
labels = append(labels, wellKnownNodeType)
labels = append(labels, nodeName)
return labels
}
Expand Down

0 comments on commit cb78fab

Please sign in to comment.