Allow machine pools to be created and scaled down to 0 #1232
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.
Issue: #1231
Problem
It's not possible to set a machine_pool quantity to 0, this blocks temporarily scaling down a pool, and instead it will be deleted. It's possible to both create and scale down clusters from the UI with a value of 0, so the provider should allow the same.
Solution
Remove the ValidateFunc: validation.IntAtLeast(1),
Testing
N/A
Engineering Testing
Manual Testing
Verified functionality by deploying to a RKE2 clusters in OpenStack with machine_pool quantity set to 0.
Automated Testing
N/A
QA Testing Considerations
N/A
Regressions Considerations
I've manually tested this change on OpenStack and it seems to work as expected. But I'm not sure if it will work with other providers.
This was first discussed in #107, and while it's not possible to create a cluster with only empty pools, it's still possible create empty pools as long as there's at least one pool with quantity >= 1.