Skip to content

Commit

Permalink
adding clone() back in as per craig condits suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
psantacl committed Aug 22, 2024
1 parent cf27fb7 commit de7b37b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/scheduler/objects/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1277,16 +1277,17 @@ func (sq *Queue) internalGetFairMaxResource(limit *resources.Resource) *resource
sq.RLock()
defer sq.RUnlock()

if sq.maxResource.IsEmpty() || limit.IsEmpty() {
return limit
out := limit.Clone()
if sq.maxResource.IsEmpty() || out.IsEmpty() {
return out
}

// perform merge. child wins every resources collision
for k, v := range sq.maxResource.Resources {
limit.Resources[k] = v
out.Resources[k] = v
}

return limit
return out
}

// GetMaxQueueSet returns the max resource for the queue. The max resource should never be larger than the
Expand Down

0 comments on commit de7b37b

Please sign in to comment.