Skip to content

Commit

Permalink
fix threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke-Smartnews committed Feb 20, 2024
1 parent b72e6de commit 0943800
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/controllers/nodeclaim/disruption/consolidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ func (e *Consolidation) Reconcile(ctx context.Context, nodePool *v1beta1.NodePoo
if err != nil {
return reconcile.Result{}, fmt.Errorf("failed to calculate memory, %w", err)
}
logging.FromContext(ctx).Infof("node %s, cpu: %v, ram: %v, threshold %v", nodeClaim.Name, cpu, memory, float64(*threshold/100))
if cpu < float64(*threshold/100) && memory < float64(*threshold/100) {
if cpu < float64(*threshold)/100 && memory < float64(*threshold)/100 {
if !hasCondition {
nodeClaim.StatusConditions().SetCondition(apis.Condition{
Type: v1beta1.Underutilized,
Expand Down

0 comments on commit 0943800

Please sign in to comment.