allow kube app to scale 0 (#10909)

pull/10919/head
Prabhat Khera 2024-01-08 08:31:31 +13:00 committed by GitHub
parent 7a1893f864
commit 317eec2790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -34,12 +34,12 @@ export function ReplicationFormSection({
<FormControl label="Instance count" required> <FormControl label="Instance count" required>
<Input <Input
type="number" type="number"
min="1" min="0"
max="9999" max="9999"
value={values.replicaCount} value={values.replicaCount}
disabled={!supportScalableReplicaDeployment} disabled={!supportScalableReplicaDeployment}
onChange={(e) => onChange={(e) =>
onChange({ replicaCount: e.target.valueAsNumber || 1 }) onChange({ replicaCount: e.target.valueAsNumber || 0 })
} }
className="w-1/4" className="w-1/4"
data-cy="k8sAppCreate-replicaCountInput" data-cy="k8sAppCreate-replicaCountInput"

View File

@ -20,7 +20,7 @@ export function replicationValidation(
} = validationData || {}; } = validationData || {};
return object({ return object({
replicaCount: number() replicaCount: number()
.min(1, 'Instance count must be greater than 0.') .min(0, 'Instance count must be greater than or equal to 0.')
.test( .test(
'overflow', 'overflow',
'This application would exceed available resources. Please review resource reservations or the instance count.', 'This application would exceed available resources. Please review resource reservations or the instance count.',