Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Exclude already completed pods from being included in the overhead ca…
Browse files Browse the repository at this point in the history
…lculation (#19)

* Excludes already successful pods from being included in the overhead calculation

* Fixes import alias issue

* Removes corev1 import alias

* Excludes failed pods as well from the overhead calculation

* Updates comment line to take into account recent changes
  • Loading branch information
rkaram authored and onursatici committed Mar 27, 2019
1 parent aa19903 commit 9458e5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/extender/overhead.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ func (o *OverheadComputer) compute(ctx context.Context) {
if podsWithRRs[p.Name] {
continue
}
if p.Spec.NodeName == "" {
// pending pod
if p.Spec.NodeName == "" || p.Status.Phase == v1.PodSucceeded || p.Status.Phase == v1.PodFailed {
// pending pod or pod succeeded or failed
continue
}
node, err := o.nodeLister.Get(p.Spec.NodeName)
Expand Down

0 comments on commit 9458e5a

Please sign in to comment.