Bug
In pkg/controllers/disruption/types.go, LogValues() computes podCount using lo.Reduce:
podCount := lo.Reduce(c.candidates, func(_ int, cd *Candidate, _ int) int {
return len(cd.reschedulablePods)
}, 0)
The first _ int parameter is the accumulator. Because it's discarded, the function returns len(cd.reschedulablePods) for the last candidate only, not the sum across all candidates.
Expected
podCount := lo.Reduce(c.candidates, func(acc int, cd *Candidate, _ int) int {
return acc + len(cd.reschedulablePods)
}, 0)
Impact
The "pod-count" field in structured disruption logs under-reports when multiple nodes are disrupted simultaneously (e.g., multi-node consolidation). Single-candidate disruptions are unaffected since last == only.
History
The line dates back to the original String() method (before commit c0e7299 refactored it to LogValues()). The refactor carried it over unchanged.
Bug
In
pkg/controllers/disruption/types.go,LogValues()computespodCountusinglo.Reduce:The first
_ intparameter is the accumulator. Because it's discarded, the function returnslen(cd.reschedulablePods)for the last candidate only, not the sum across all candidates.Expected
Impact
The
"pod-count"field in structured disruption logs under-reports when multiple nodes are disrupted simultaneously (e.g., multi-node consolidation). Single-candidate disruptions are unaffected since last == only.History
The line dates back to the original
String()method (before commit c0e7299 refactored it toLogValues()). The refactor carried it over unchanged.