1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

fix(app): NaN validation for autoscaling [EE-6714] (#11237)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run

This commit is contained in:
Ali 2024-02-22 17:36:44 +13:00 committed by GitHub
parent 90451bfd47
commit 8856bae5c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 8 deletions

View file

@ -23,8 +23,8 @@ export function resourceReservationValidation(
validationData?: ValidationData
): SchemaOf<ResourceQuotaFormValues> {
return object().shape({
memoryLimit: nanNumberSchema()
.min(0, 'Value must be greater than or equal to 0')
memoryLimit: nanNumberSchema('Memory limit is required.')
.min(0, 'Value must be greater than or equal to 0.')
.test(
'exhaused',
`The memory capacity for this namespace has been exhausted, so you cannot deploy the application.${
@ -37,7 +37,7 @@ export function resourceReservationValidation(
.max(
validationData?.maxMemoryLimit || 0,
({ value }) =>
`Value must be between 0 and ${validationData?.maxMemoryLimit}MB now - the previous value of ${value} exceeds this`
`Value must be between 0 and ${validationData?.maxMemoryLimit}MB now - the previous value of ${value} exceeds this.`
)
.test(
'hasSuitableNode',
@ -56,7 +56,7 @@ export function resourceReservationValidation(
);
}
)
.required(),
.required('Memory limit is required.'),
cpuLimit: number()
.min(0)
.test(
@ -71,7 +71,7 @@ export function resourceReservationValidation(
.max(
validationData?.maxCpuLimit || 0,
({ value }) =>
`Value must be between 0 and ${validationData?.maxCpuLimit} now - the previous value of ${value} exceeds this`
`Value must be between 0 and ${validationData?.maxCpuLimit} now - the previous value of ${value} exceeds this.`
)
.test(
'hasSuitableNode',