1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 06:19:41 +02:00
portainer/app/react/kubernetes/applications/components/PlacementFormSection/placementValidation.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
514 B
TypeScript
Raw Normal View History

import { SchemaOf, array, boolean, mixed, object, string } from 'yup';
import { PlacementsFormValues } from './types';
export function placementsValidation(): SchemaOf<PlacementsFormValues> {
return object({
placementType: mixed().oneOf(['mandatory', 'preferred']).required(),
placements: array(
object({
label: string().required('Node label is required.'),
value: string().required('Node value is required.'),
needsDeletion: boolean(),
}).required()
),
});
}