From df42ce87236c151a6b345eab36dace824bca9b9e Mon Sep 17 00:00:00 2001 From: knguyen100000010 <63071572+knguyen100000010@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:37:36 -0500 Subject: [PATCH] Additional step scaling validations (#1460) * check if min adjustment is empty * both scale up and down steps cannot be empty --- deploy-board/deploy_board/templates/groups/asg_policy.tmpl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy-board/deploy_board/templates/groups/asg_policy.tmpl b/deploy-board/deploy_board/templates/groups/asg_policy.tmpl index 7e112243c7..493bdac3c5 100644 --- a/deploy-board/deploy_board/templates/groups/asg_policy.tmpl +++ b/deploy-board/deploy_board/templates/groups/asg_policy.tmpl @@ -462,7 +462,7 @@ aria-hidden="true"> var minAdjustmentMagnitude = config["minAdjustmentMagnitude"].trim() var instanceWarmup = config["instanceWarmup"].trim() - if (/^-?\d+$/.test(minAdjustmentMagnitude) == false) { + if (/^-?\d+$/.test(minAdjustmentMagnitude) == false && minAdjustmentMagnitude.length != 0) { alert("minAdjustmentMagnitude must be >= 1") return false } @@ -489,6 +489,11 @@ aria-hidden="true"> var scaleDownSteps = config["scaleDownSteps"].trim(); var scaleDownAdjustments = config["scaleDownAdjustments"].trim(); + if (scaleUpSteps.length == 0 && scaleDownSteps.length == 0) { + alert("Both scale up and down steps cannot be empty!") + return false; + } + if (scaleUpSteps.length > 0 && scaleUpAdjustments.length == 0) { alert("Scale up adjustments must be provided for scale up steps!") return false;