fix(core): Max remaining ASG should honor value being removed #6522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
maxRemainingAsgs use default placeholder value of 2 even if it is manually removed.
Scenario: A user configures a deploy stage with redblack and creates a cluster. This has a default maxRemainingAsg value of 2 by default. Now the user removes the maxRemainingAsgs from the pipeline JSON and saves the config. When the user gets to the cluster configuration in the UI, the maxRemainingAsg is set to 2 even though the value has been removed. This is incorrect because now the number of remaining ASGs is infinite and not 2 because it is not set.
In this solution, I read if the strategy has already been set to determine if its a first time cluster config or existing cluster config. Based on that, it chooses whether to show the default values or not. This solution is easier than passing down if the cluster is in "create" or "edit" mode.