Merge pull request #2777 from pikasTech/fix/nc01-reclaim-plan-eligibility

fix: 恢复精确内存回收计划可决策输出
This commit is contained in:
Lyon
2026-07-21 20:07:10 +08:00
committed by GitHub
+6 -2
View File
@@ -439,13 +439,16 @@ function compactMemoryPressureCandidate(value: unknown): Record<string, unknown>
action: { op: action.op, allowlist: action.allowlist },
};
if (candidate.kind === "cgroup-memory-reclaim") {
const memoryStat = recordOrEmpty(candidate.memoryStat);
return {
...base,
id: candidate.id,
kind: candidate.kind,
configId: candidate.configId,
reason: candidate.reason,
risk: candidate.risk,
path: candidate.path,
workloadSelector: compactWorkloadSelector(candidate.workloadSelector),
resolvedPod: compactResolvedPod(candidate.resolvedPod),
reclaimBytes: candidate.reclaimBytes,
requestedMemoryReclaimBytes: candidate.requestedMemoryReclaimBytes,
requestedMemoryReclaim: candidate.requestedMemoryReclaim,
estimateKind: candidate.estimateKind,
@@ -453,6 +456,7 @@ function compactMemoryPressureCandidate(value: unknown): Record<string, unknown>
minimumInactiveAnonBytes: candidate.minimumInactiveAnonBytes,
memoryCurrentBytes: candidate.memoryCurrentBytes,
memorySwapCurrentBytes: candidate.memorySwapCurrentBytes,
inactiveAnonBytes: memoryStat.inactive_anon,
};
}
const identities = Array.isArray(candidate.processIdentities) ? candidate.processIdentities.map(recordOrEmpty) : [];