From 1c22eda5569833b92445365923fff60bf98a9aad Mon Sep 17 00:00:00 2001 From: Reed Schalo Date: Wed, 23 Oct 2024 14:40:52 -0700 Subject: [PATCH] fix: check for nil pointer dereference (#1763) --- pkg/controllers/disruption/multinodeconsolidation.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/disruption/multinodeconsolidation.go b/pkg/controllers/disruption/multinodeconsolidation.go index e033aa176b..2e2039c1a0 100644 --- a/pkg/controllers/disruption/multinodeconsolidation.go +++ b/pkg/controllers/disruption/multinodeconsolidation.go @@ -209,7 +209,10 @@ func filterOutSameType(newNodeClaim *scheduling.NodeClaim, consolidate []*Candid } // swallow the error since we don't allow min values to impact reschedulability in multi node claim newNodeClaim, err := newNodeClaim.RemoveInstanceTypeOptionsByPriceAndMinValues(newNodeClaim.Requirements, maxPrice) - return newNodeClaim.InstanceTypeOptions, err + if err != nil { + return nil, err + } + return newNodeClaim.InstanceTypeOptions, nil } func (m *MultiNodeConsolidation) Reason() v1.DisruptionReason {