From 317eec2790c14ff6540b3527597715bcdda909b8 Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Mon, 8 Jan 2024 08:31:31 +1300 Subject: [PATCH] allow kube app to scale 0 (#10909) --- .../ReplicationFormSection/ReplicationFormSection.tsx | 4 ++-- .../ReplicationFormSection/replicationValidation.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/react/kubernetes/applications/components/ReplicationFormSection/ReplicationFormSection.tsx b/app/react/kubernetes/applications/components/ReplicationFormSection/ReplicationFormSection.tsx index c7ee59946..fd20bf523 100644 --- a/app/react/kubernetes/applications/components/ReplicationFormSection/ReplicationFormSection.tsx +++ b/app/react/kubernetes/applications/components/ReplicationFormSection/ReplicationFormSection.tsx @@ -34,12 +34,12 @@ export function ReplicationFormSection({ - onChange({ replicaCount: e.target.valueAsNumber || 1 }) + onChange({ replicaCount: e.target.valueAsNumber || 0 }) } className="w-1/4" data-cy="k8sAppCreate-replicaCountInput" diff --git a/app/react/kubernetes/applications/components/ReplicationFormSection/replicationValidation.ts b/app/react/kubernetes/applications/components/ReplicationFormSection/replicationValidation.ts index 9dcbadcab..8a24a62a8 100644 --- a/app/react/kubernetes/applications/components/ReplicationFormSection/replicationValidation.ts +++ b/app/react/kubernetes/applications/components/ReplicationFormSection/replicationValidation.ts @@ -20,7 +20,7 @@ export function replicationValidation( } = validationData || {}; return object({ replicaCount: number() - .min(1, 'Instance count must be greater than 0.') + .min(0, 'Instance count must be greater than or equal to 0.') .test( 'overflow', 'This application would exceed available resources. Please review resource reservations or the instance count.',