ARO-28167: support control plane resize zone topologies - #5010
ARO-28167: support control plane resize zone topologies#5010tuxerrante wants to merge 2 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
/test all |
Here is my review of the changes in this PR. SummaryThe core topology classification logic is sound and the test coverage is comprehensive. All tests pass. A few minor items below:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the admin control-plane resize pre-validation logic to explicitly classify supported control-plane availability zone topology shapes (regional/no-zone, single-zone, three-zone) rather than assuming all valid control planes must span three distinct AZs. This aligns validation with real Azure VM zoning semantics (including Zones == nil / empty slice meaning regional) while keeping mixed/partial layouts rejected with deterministic error output.
Changes:
- Introduce
classifyZoneTopologyto validate/control-plane-scope supported zone topologies and return a topology classification. - Treat Azure VMs with nil/empty
Zonesas regional VMs (valid), and accept single-zone control planes. - Update and expand unit tests to cover the new topology matrix and deterministic mixed-topology error messaging.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/frontend/admin_openshiftcluster_resize_validation_helpers.go | Replace “must be 3 distinct zones” validation with topology classification; treat empty/nil VM zones as regional; improve determinism for mixed-topology errors. |
| pkg/frontend/admin_openshiftcluster_resize_validation_helpers_test.go | Update tests for topology classification and add coverage for regional/single-zone and nil/empty Azure VM zones. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4258ce0 to
86d1cfa
Compare
Handle regional, single-zone, and three-zone control plane layouts during resize validation while keeping mixed topologies deterministic and aligned with the existing control plane zone count invariant.
Exercise regional, single-zone, and three-zone validation paths and pin the mixed-topology and machine-to-VM mismatch cases that protect the resize prechecks.
86d1cfa to
9919d25
Compare
|
@copilot review |
All the feedback from the previous review has been incorporated in the existing commits:
The CI |
|
Current CI note: the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
pkg/frontend/admin_openshiftcluster_resize_validation_helpers.go:359
- validateVMPowerState currently only checks that there are at least 2 statuses and that all statuses are in the allowed set. This can incorrectly accept a VM that is missing one of the required states (e.g., two copies of "PowerState/running" with no provisioning state, or vice versa), despite the comment saying both provisioning and power states are required.
func validateVMPowerState(log *logrus.Entry, vmStatuses []string, vmName string) error {
// We require at least the provisioning and power states; any additional
// statuses are validated below and rejected if unexpected.
if len(vmStatuses) < 2 {
err := fmt.Errorf("expected 2 statuses for VM %s, but found %d: %s", vmName, len(vmStatuses), strings.Join(vmStatuses, ", "))
Which issue this PR addresses:
Fixes ARO-28167
What this PR does / why we need it:
This updates the control plane resize pre-validation logic so it classifies the supported topology shapes explicitly instead of assuming every valid control plane must span three distinct availability zones. The change now accepts regional/no-zone, single-zone, and three-zone control planes, while still rejecting mixed or partial layouts such as
1/1/2and zonal/regional combinations.Reviewer notes:
Zones == nilorZones == []are treated as regional VMs, not as invalid state.classifyZoneTopologyhelper is generic over input type, but it is still intentionally control-plane-scoped because it enforcesazurezones.CONTROL_PLANE_MACHINE_COUNT. If future Capacity Reservation / CRG validation needs a different cardinality, the expected count should be passed into the helper or kept at the caller instead of assuming3.Test plan for issue:
Executed:
make fmtgit diff --checkmake lint-gomake unit-test-gogo test -count=1 ./pkg/frontend/...make test-gowas executed to assess the broader repo validator behavior; it currently chains mutating generation/import-fix steps, so unrelated generated churn was reverted and it was not used as the clean publish gate for this branch.Automated coverage added/updated for:
nilAzure VM zone handlingNot executed:
Is there any documentation that needs to be updated for this PR?
No product or customer-facing documentation changes are needed for this PR because the change is limited to internal admin resize validation behavior.
Suggested separate repo/process documentation follow-up:
make test-gois a broader validation workflow, not just a pure unit-test target, or introduce a clearly named non-mutating test target for contributor feedback loops.How do you know this will function as expected in production?