From cf88570c39f5311e4edb7c1730188ab24605ac8c Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Fri, 12 Jan 2024 09:40:55 +1300 Subject: [PATCH] update validation for storage classes (#10940) --- .../cluster/ConfigureView/ConfigureForm/validation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/react/kubernetes/cluster/ConfigureView/ConfigureForm/validation.ts b/app/react/kubernetes/cluster/ConfigureView/ConfigureForm/validation.ts index cbff9563b..bb5c3def9 100644 --- a/app/react/kubernetes/cluster/ConfigureView/ConfigureForm/validation.ts +++ b/app/react/kubernetes/cluster/ConfigureView/ConfigureForm/validation.ts @@ -23,14 +23,15 @@ const storageClassFormValuesSchema = array() }) ) .test( - // invalid if any storage class is not selected or if it's selected and at least one access mode is selected + // invalid if any storage class is not selected or + // if it's selected and at least one access mode is selected 'accessModes', 'Shared access policy configuration required.', (storageClasses) => { const isValid = storageClasses?.every( (value) => !value.selected || - value.AccessModes?.some((accessMode) => accessMode.selected) + (value.AccessModes && value.AccessModes?.length > 0) ); return isValid || false; }