OCM-23235 |fix: remove validation for hcp cluster nodes size#3227
OCM-23235 |fix: remove validation for hcp cluster nodes size#3227marcolan018 wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marcolan018 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/hold |
olucasfreitas
left a comment
There was a problem hiding this comment.
Two blocking issues: missing unit test coverage for the changed function, and an unaddressed side effect on the non-autoscaling code path.
| return err | ||
| } | ||
|
|
||
| if r.IsHostedCp && minReplicas < 2 { |
There was a problem hiding this comment.
MinReplicaValidatorOnClusterCreate has zero unit test coverage in helper_test.go. Existing tests only cover MinReplicaValidator (nodepool level, line 520-571). A behavior change to an untested function must not merge without tests.
Add a DescribeTable in helper_test.go covering at minimum:
- HCP:
min_replicas=0with validprivateSubnetsCount(pass) - HCP: negative
min_replicas(fail) - HCP: exceeds 500-node limit (fail)
- HCP:
min_replicasnot divisible byprivateSubnetsCount(fail) - Classic: boundary cases for 180/249 node limits
| "but %d was requested", minReplicas) | ||
| } | ||
|
|
||
| err = validateClusterVersionWithMaxNodesLimit( |
There was a problem hiding this comment.
This validator is also invoked for non-autoscaling --compute-nodes in cmd/create/cluster/cmd.go:2849. With this removal, rosa create cluster --compute-nodes=0 on HCP without autoscaling now passes client-side validation.
If 0 nodes without autoscaling is not a valid HCP configuration, scope this removal to the autoscaling path only — the Autoscaling field already exists on ReplicaSizeValidation and can gate the check.
If the server rejects it anyway, document that explicitly in the PR description so reviewers can verify.
PR Summary
remove validation for hcp cluster nodes size
Detailed Description of the Issue
To support min_replicas=0, in issue https://redhat.atlassian.net/browse/OCM-21663, we had changed the validation on nodepool min_replicas size. This PR focuses on the min_replicas size validation during cluster creation.
Related Issues and PRs
#Type of Change
Previous Behavior
Behavior After This Change
How to Test (Step-by-Step)
Preconditions
Test Steps
Expected Results
Proof of the Fix
Breaking Changes
Breaking Change Details / Migration Plan
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make testpasses.make lintpasses.make rosapasses.