Skip to content

Commit

Permalink
account for all covered resources when a node is cordoned
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrove-oss committed Aug 27, 2024
1 parent f5d8153 commit 844c521
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/controller/appwrapper/node_health_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ func (r *NodeHealthMonitor) Reconcile(ctx context.Context, req ctrl.Request) (ct
// update unschedulable resource quantities for this node
flaggedQuantities := make(map[string]*resource.Quantity)
if node.Spec.Unschedulable {
// flag all configured resources if the node is cordoned
for resourceName := range r.Config.Autopilot.ResourceTaints {
flaggedQuantities[resourceName] = node.Status.Capacity.Name(v1.ResourceName(resourceName), resource.DecimalSI)
// flag all non-pod resources covered by cq if the node is cordoned
for _, resourceName := range cq.Spec.ResourceGroups[0].Flavors[0].Resources {
if string(resourceName.Name) != "pod" {
flaggedQuantities[string(resourceName.Name)] = node.Status.Capacity.Name(resourceName.Name, resource.DecimalSI)
}
}
} else {
for key, value := range node.GetLabels() {
Expand Down

0 comments on commit 844c521

Please sign in to comment.