fix: lo.Reduce in Command.LogValues discards accumulator#2912
fix: lo.Reduce in Command.LogValues discards accumulator#2912abhinavdahiya wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
The lo.Reduce call in LogValues() was ignoring the accumulator parameter, so it returned only the last candidate's reschedulable pod count instead of the sum across all candidates. This caused the "pod-count" field in structured disruption logs to under-report during multi-node consolidation. Fixes kubernetes-sigs#2888
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: abhinavdahiya The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @abhinavdahiya! |
|
Hi @abhinavdahiya. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Fixes #2888
Description
The
lo.Reducecall inLogValues()was ignoring the accumulator parameter, so it returned only the last candidate's reschedulable pod count instead of the sum across all candidates. This caused the"pod-count"field in structured disruption logs to under-report during multi-node consolidation.How was this change tested?
Added
TestLogValues_PodCountthat creates aCommandwith two candidates (3 and 2 reschedulable pods) and verifies the pod count is the sum (5), not the last candidate's count (2). Full disruption test suite passes (232/232).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.