fix(app): parse nan in validation check [EE-6714] (#11247)

pull/11254/head
Ali 9 months ago committed by GitHub
parent 6258c02353
commit f8b68a809f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -99,6 +99,8 @@ function hasSuitableNode(
cpuLimit: number, cpuLimit: number,
nodeLimits: NodesLimits nodeLimits: NodesLimits
) { ) {
const nanParsedMemoryLimit = Number.isNaN(memoryLimit) ? 0 : memoryLimit;
const nanParsedCPULimit = Number.isNaN(cpuLimit) ? 0 : cpuLimit;
// transform the nodelimits from bytes to MB // transform the nodelimits from bytes to MB
const limits = Object.values(nodeLimits).map((nodeLimit) => ({ const limits = Object.values(nodeLimits).map((nodeLimit) => ({
...nodeLimit, ...nodeLimit,
@ -108,6 +110,8 @@ function hasSuitableNode(
})); }));
// make sure there's a node available with enough memory and cpu // make sure there's a node available with enough memory and cpu
return limits.some( return limits.some(
(nodeLimit) => nodeLimit.Memory >= memoryLimit && nodeLimit.CPU >= cpuLimit (nodeLimit) =>
nodeLimit.Memory >= nanParsedMemoryLimit &&
nodeLimit.CPU >= nanParsedCPULimit
); );
} }

Loading…
Cancel
Save