Skip to content

Commit

Permalink
Additional step scaling validations (#1460)
Browse files Browse the repository at this point in the history
* check if min adjustment is empty

* both scale up and down steps cannot be empty
  • Loading branch information
knguyen100000010 authored Feb 22, 2024
1 parent 3054088 commit df42ce8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deploy-board/deploy_board/templates/groups/asg_policy.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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;
Expand Down

0 comments on commit df42ce8

Please sign in to comment.