Skip to content

Commit

Permalink
chore: remove unnecessary for delete errors (#1770)
Browse files Browse the repository at this point in the history
Signed-off-by: helen <[email protected]>
  • Loading branch information
helen-frank authored Oct 23, 2024
1 parent ed8f88e commit ecd5dd4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/controllers/provisioning/scheduling/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func (s *Scheduler) Solve(ctx context.Context, pods []*corev1.Pod) Results {

// Schedule to existing nodes or create a new node
if errors[pod] = s.add(ctx, pod); errors[pod] == nil {
delete(errors, pod)
continue
}

Expand All @@ -233,12 +234,7 @@ func (s *Scheduler) Solve(ctx context.Context, pods []*corev1.Pod) Results {
for _, m := range s.newNodeClaims {
m.FinalizeScheduling()
}
// clear any nil errors, so we can know that len(PodErrors) == 0 => all pods scheduled
for k, v := range errors {
if v == nil {
delete(errors, k)
}
}

return Results{
NewNodeClaims: s.newNodeClaims,
ExistingNodes: s.existingNodes,
Expand Down

0 comments on commit ecd5dd4

Please sign in to comment.