diff --git a/pkg/scheduler/frameworkext/eventhandlers/reservation_handler.go b/pkg/scheduler/frameworkext/eventhandlers/reservation_handler.go index c5e2b93aa..9eafb6034 100644 --- a/pkg/scheduler/frameworkext/eventhandlers/reservation_handler.go +++ b/pkg/scheduler/frameworkext/eventhandlers/reservation_handler.go @@ -169,7 +169,10 @@ func generatePodEventOnReservationLevel(errorMsg string) (string, bool) { } } else if reserveDetailRe.MatchString(trimItem) { // not total item, append to details, e.g. " 1 Reservation(s) ..." - resultDetails = append(resultDetails, trimItem) + + // for 1 Reservation(s) Insufficient nvidia, replace nvidia with nvidia.com/gpu + itemReplaced := strings.Replace(trimItem, "nvidia", "nvidia.com/gpu", -1) + resultDetails = append(resultDetails, itemReplaced) } else { // other node items, record affinity errors on reservation level as: // "at least 3 didn't match pod topology spread constraints Reservation(s)" diff --git a/pkg/scheduler/frameworkext/eventhandlers/reservation_handler_test.go b/pkg/scheduler/frameworkext/eventhandlers/reservation_handler_test.go index ed5e5962c..c1a836d4d 100644 --- a/pkg/scheduler/frameworkext/eventhandlers/reservation_handler_test.go +++ b/pkg/scheduler/frameworkext/eventhandlers/reservation_handler_test.go @@ -1335,6 +1335,13 @@ func Test_generatePodEventOnReservationLevel(t *testing.T) { "2 Reservation(s) Insufficient cpu, 1 Reservation(s) Insufficient memory.", wantIsReserve: true, }, + { + name: "reservation gpu resource not enough", + errorMsg: "0/21 nodes are available: 1 Insufficient nvidia.com/gpu by node, 4 Reservation(s) Insufficient nvidia.com/gpu. " + + "1 Reservation(s) is unschedulable, 5 Reservation(s) matched owner total", + wantMsg: "0/5 reservations are available: 4 Reservation(s) Insufficient nvidia.com/gpu, 1 Reservation(s) is unschedulable.", + wantIsReserve: true, + }, { name: "pod topology spread constraints missing required label errors", errorMsg: "0/5 nodes are available: 3 node(s) didn't match pod topology spread constraints (missing required label)," +