From 07c14714e59284954fda643dec3d6315b81d231c Mon Sep 17 00:00:00 2001 From: John Wregglesworth Date: Tue, 6 Dec 2022 15:44:52 -0700 Subject: [PATCH] Add guard check for the resource name for overage detection --- internal/limits.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/limits.go b/internal/limits.go index 4798458..2299382 100644 --- a/internal/limits.go +++ b/internal/limits.go @@ -198,7 +198,7 @@ func validateJobLimits(user string, defaultJobLimit, jobCount int, jobLimit *int details := make(map[string]interface{}) for _, ov := range overages.Overages { - if ov.Usage >= ov.Quota { + if ov.Usage >= ov.Quota && ov.ResourceName == "cpu.hours" { inOverage = true details[ov.ResourceName] = fmt.Sprintf("quota: %f, usage: %f", ov.Quota, ov.Usage) }