From 187acca739d6000ead7909f2ccf06cc9ef48a37a Mon Sep 17 00:00:00 2001 From: robjmorrissey Date: Fri, 17 Feb 2023 04:23:57 +0000 Subject: [PATCH] Max volume size --- src/utils/zod/ignite.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/zod/ignite.ts b/src/utils/zod/ignite.ts index fcdccaa8..7328e114 100644 --- a/src/utils/zod/ignite.ts +++ b/src/utils/zod/ignite.ts @@ -18,7 +18,9 @@ export const deploymentMetaDataSchema = z.object({ const UNIX_DIR_REGEX = /^\/([a-zA-Z0-9_\-]+\/)*([a-zA-Z0-9_\-]+)$/g; -const MIN_VOLUME_SIZE_BYTES = 1073741824; // 1gb +const MIN_VOLUME_SIZE_BYTES = 1024 * 1024 * 1024; +const MAX_VOLUME_SIZE_BYTES = 500 * 1024 * 1024 * 1024; + const MIN_RAM_SIZE_BYTES = 134217728; export const volumeFormatSchema = z.nativeEnum(VolumeFormat); @@ -39,7 +41,7 @@ export const volumeSchema = z try { const size = parseSize(v); - return size >= MIN_VOLUME_SIZE_BYTES; + return size >= MIN_VOLUME_SIZE_BYTES && size <= MAX_VOLUME_SIZE_BYTES; } catch (err) { return false; }