From ec78ea202bd6d017cf247f1b621e87184b308da6 Mon Sep 17 00:00:00 2001 From: Mohamed Abdelfatah <39927413+Mo-Fatah@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:14:44 +0200 Subject: [PATCH] add JobRunPreemptedError case (#3380) Signed-off-by: Mohamed Abdelfatah --- internal/scheduler/metrics/metrics.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/scheduler/metrics/metrics.go b/internal/scheduler/metrics/metrics.go index 4bfa38d7b6b..3d4ef5613ee 100644 --- a/internal/scheduler/metrics/metrics.go +++ b/internal/scheduler/metrics/metrics.go @@ -27,6 +27,7 @@ const ( podError = "podError" podLeaseReturned = "podLeaseReturned" podTerminated = "podTerminated" + jobRunPreempted = "jobRunPreempted" queued = "queued" cancelled = "cancelled" @@ -363,6 +364,8 @@ func errorTypeAndMessageFromError(ctx *armadacontext.Context, err *armadaevents. return podLeaseReturned, reason.PodLeaseReturned.Message case *armadaevents.Error_PodTerminated: return podTerminated, reason.PodTerminated.Message + case *armadaevents.Error_JobRunPreemptedError: + return jobRunPreempted, "" default: ctx.Warnf("omitting name and message for unknown error type %T", err.Reason) return "", ""