Skip to content

Commit

Permalink
Merge pull request #1830 from vbnrh/fix-pool-name-check
Browse files Browse the repository at this point in the history
Fix pool name check for blockpools
  • Loading branch information
openshift-merge-bot[bot] authored Jan 23, 2025
2 parents a788f9a + 12a9266 commit 2c83b49
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/ocs/storage-pool/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,18 @@ export const StoragePoolBody: React.FC<StoragePoolBodyProps> = ({
.test(
'unique-name',
translationFieldRequirements[3],
(value: string) => !existingNames.includes(value)
(value: string) =>
!existingNames.includes(
usePrefix ? `${prefixName}-${value}` : value
)
),
});

return {
schema: validationSchema,
fieldRequirements: translationFieldRequirements,
};
}, [existingNames, t]);
}, [prefixName, usePrefix, existingNames, t]);

const resolver = useYupValidationResolver(schema);
const {
Expand Down

0 comments on commit 2c83b49

Please sign in to comment.