Add reason as comment for ignoring returned error in allocateResource

This commit is contained in:
ionutboangiu
2021-05-11 17:23:47 +03:00
committed by Dan Christian Bogos
parent 1db592ea8d
commit 7e7a1ded59

View File

@@ -289,7 +289,7 @@ func (rs Resources) allocateResource(ru *ResourceUsage, dryRun bool) (alcMessage
for _, r := range rs {
r.removeExpiredUnits()
if _, hasID := r.Usages[ru.ID]; hasID && !dryRun { // update
r.clearUsage(ru.ID)
r.clearUsage(ru.ID) // clearUsage returns error only when ru.ID does not exist in the Usages map
}
if r.rPrf == nil {
err = fmt.Errorf("empty configuration for resourceID: %s", r.TenantID())