From a16844d9de19d42347142f17efa282cd0b83ed76 Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Fri, 12 Jan 2024 16:21:17 +0200 Subject: [PATCH] Make sure requested limits are numbers --- src/util/extractResourceLimitsFromRequest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/extractResourceLimitsFromRequest.ts b/src/util/extractResourceLimitsFromRequest.ts index e989a1e..8d33c6c 100644 --- a/src/util/extractResourceLimitsFromRequest.ts +++ b/src/util/extractResourceLimitsFromRequest.ts @@ -11,8 +11,8 @@ export default function extractResourceLimitsFromRequest( // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types requestBody: any, ): ResourceLimits { - let memoryGB = requestBody.memory_limit_gb ?? 1 - let cpus = requestBody.cpu_limit ?? 1 + let memoryGB = Number(requestBody.memory_limit_gb ?? 1) + let cpus = Number(requestBody.cpu_limit ?? 1) if (memoryGB > MAX_MEMORY_REQUEST_GB) { memoryGB = MAX_MEMORY_REQUEST_GB }