Skip to content

Commit

Permalink
move FlavorResourceQuantities to cache
Browse files Browse the repository at this point in the history
remove Preemption setting in MakeClusterQueue
  • Loading branch information
KunWuLuan committed Oct 7, 2023
1 parent 4cdc10f commit 50475bd
Show file tree
Hide file tree
Showing 14 changed files with 275 additions and 208 deletions.
8 changes: 4 additions & 4 deletions keps/582-preempt-based-on-flavor-order/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,21 +246,21 @@ func assignFlavors(log logr.Logger, requests []workload.PodSetResources, podSets
var assignment Assignment
if lastAssignment != nil {
assignment = Assignment{
TotalBorrow: make(workload.FlavorResourceQuantities),
TotalBorrow: make(cache.FlavorResourceQuantities),
PodSets: make([]PodSetAssignment, 0, len(requests)),
LastState: *lastAssignment,
Usage: make(workload.FlavorResourceQuantities),
Usage: make(cache.FlavorResourceQuantities),
}
} else {
assignment = Assignment{
TotalBorrow: make(workload.FlavorResourceQuantities),
TotalBorrow: make(cache.FlavorResourceQuantities),
PodSets: make([]PodSetAssignment, 0, len(requests)),
LastState: workload.AssigmentClusterQueueState{
LastAssignedFlavorIdx: make([]map[corev1.ResourceName]int, 0, len(podSets)),
CohortGeneration: 0,
ClusterQueueGeneration: cq.Generation,
},
Usage: make(workload.FlavorResourceQuantities),
Usage: make(cache.FlavorResourceQuantities),
}
if cq.Cohort != nil {
assignment.LastState.CohortGeneration = cq.Cohort.Generation
Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (c *Cache) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) err
qImpl := &queue{
key: qKey,
admittedWorkloads: 0,
usage: make(workload.FlavorResourceQuantities),
usage: make(FlavorResourceQuantities),
}
if err = qImpl.resetFlavorsAndResources(cqImpl.Usage); err != nil {
return err
Expand Down

0 comments on commit 50475bd

Please sign in to comment.