Skip to content

Commit

Permalink
koord-manager: fix gpu name to nvidia/gpu in reservation level event
Browse files Browse the repository at this point in the history
Signed-off-by: 佑祎 <zzw261520@alibaba-inc.com>
  • Loading branch information
zwzhang0107 committed May 29, 2024
1 parent 0eac242 commit b008dc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)," +
Expand Down

0 comments on commit b008dc1

Please sign in to comment.