bhouse-nexthop opened a new pull request, #14808:
URL: https://github.com/apache/cloudstack/pull/14808
### Description
This PR stops `scaleKubernetesCluster` from changing node offerings when the
request has no `serviceofferingid` and no `nodeofferings`.
| Request | Before | Now |
|---|---|---|
| `clustersize` only | node types on another offering scaled back to the
cluster offering (fails on KVM with running VMs, sometimes after the downscale
already ran) | size change only |
| `nodeids` (autoscaler node removal) | same | removal only |
| `autoscalingenabled` / min / max | same, then autoscaler set up |
autoscaler change only |
| `serviceofferingid` | all nodes to that offering | unchanged |
| `nodeofferings` | listed node types to their offerings | unchanged |
| Change | Why |
|---|---|
| `createNodeTypeToServiceOfferingMap` returns an empty map when no offering
is passed | the cluster offering was used as an implicit target |
| Worker node type isn't skipped when only autoscaling changes | with no
worker offering in the map the loop would skip it and drop the change (also hit
before with `nodeofferings` for control/etcd only) |
| `testCreateNodeTypeToServiceOfferingMapNullMap` replaced | it asserted the
old fallback to the cluster offering, which is the bug |
Related: #14806 (same files) makes size-scale accounting and the capacity
check use the worker offering. Without it, a size-only scale here keeps the
worker offering on the VMs but still records cores/memory with the cluster
offering. The two merge cleanly together.
Fixes: #14807
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### How Has This Been Tested?
- `KubernetesClusterManagerImplTest`: no offering gives an empty map;
`serviceofferingid` alone gives `DEFAULT`.
- `KubernetesClusterScaleWorkerTest` (`scaleCluster`, workers on a different
offering than the cluster):
- size-only scale: size changed, no offering scale
- enable / disable autoscaling with an empty map: autoscaler called, no
offering scale (enable test fails without the worker change)
- explicit cluster offering: only the differing worker type is scaled
- All `kubernetes-service` unit tests pass, on this branch and merged with
#14806.
#### How did you try to break this feature and the system with this change?
- Autoscaling-only request with an empty map: worker still processed.
- `nodeids`: constructor derives the size, so removal still runs.
- Clusters where all nodes share the cluster offering: same result as before.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]