Merge pull request #113 from ctk-hq/fix/deploy-fields

fix: service deploy field validation
pull/114/head
Artem Golub 3 years ago committed by GitHub
commit 229129a64f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -195,7 +195,7 @@ export const validationSchema = yup.object({
limits: yup.object({ limits: yup.object({
cpus: yup.string(), cpus: yup.string(),
memory: yup.string(), memory: yup.string(),
pids: yup.string() pids: yup.number().typeError("PIDs should be an integer")
}), }),
reservations: yup.object({ reservations: yup.object({
cpus: yup.string(), cpus: yup.string(),
@ -205,11 +205,11 @@ export const validationSchema = yup.object({
restartPolicy: yup.object({ restartPolicy: yup.object({
condition: yup.string().oneOf(["", "none", "on-failure", "any"]), condition: yup.string().oneOf(["", "none", "on-failure", "any"]),
delay: yup.string(), delay: yup.string(),
maxAttempts: yup.string(), maxAttempts: yup.number().typeError("max attempts should be an integer"),
window: yup.string() window: yup.string()
}), }),
rollbackConfig: yup.object({ rollbackConfig: yup.object({
parallelism: yup.string(), parallelism: yup.number().typeError("parallelism should be an integer"),
delay: yup.string(), delay: yup.string(),
failureAction: yup.string().oneOf(["", "continue", "pause"]), failureAction: yup.string().oneOf(["", "continue", "pause"]),
monitor: yup.string(), monitor: yup.string(),
@ -217,7 +217,7 @@ export const validationSchema = yup.object({
order: yup.string().oneOf(["", "stop-first", "start-first"]) order: yup.string().oneOf(["", "stop-first", "start-first"])
}), }),
updateConfig: yup.object({ updateConfig: yup.object({
parallelism: yup.string(), parallelism: yup.number().typeError("parallelism should be an integer"),
delay: yup.string(), delay: yup.string(),
failureAction: yup.string().oneOf(["", "continue", "pause"]), failureAction: yup.string().oneOf(["", "continue", "pause"]),
monitor: yup.string(), monitor: yup.string(),

@ -2,7 +2,6 @@ import { AnchorId } from "@jsplumb/common";
import { Dictionary } from "lodash"; import { Dictionary } from "lodash";
import { FunctionComponent, ReactNode } from "react"; import { FunctionComponent, ReactNode } from "react";
import { KeyValuePair } from "tailwindcss/types/config"; import { KeyValuePair } from "tailwindcss/types/config";
import { string } from "yup";
import { NodeGroupType } from "./enums"; import { NodeGroupType } from "./enums";
type KeyValPair = { type KeyValPair = {

Loading…
Cancel
Save