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; }