OCPBUGS-65824: Add dynamic NodePort range validation to prevent cluster creation failures#7652
OCPBUGS-65824: Add dynamic NodePort range validation to prevent cluster creation failures#7652jparrill wants to merge 2 commits intoopenshift:mainfrom
Conversation
Add validation for NodePort.Port to ensure ports fall within the cluster's configured ServiceNodePortRange. This prevents late failures during cluster provisioning when the control-plane-operator rejects ports outside the acceptable range. The validation: - Reads cluster-specific ServiceNodePortRange or uses default (30000-32767) - Validates NodePort.Port against the configured range - Allows port 0 (dynamic assignment) - Provides clear error messages with the actual configured range Fixes an issue where specifying invalid NodePort values (e.g., 10000) would cause cluster creation to fail after resources were created. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com> Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
Add .work/ directory to gitignore to exclude Claude Code working directory from version control. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com> Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
WalkthroughThis PR adds NodePort range validation to the HostedCluster controller by introducing internal helper functions to parse and validate node port ranges. It includes comprehensive tests for the new functionality and adds a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
/auto-cc |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
/test unit |
|
/test verify |
1 similar comment
|
/test verify |
|
@jparrill: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What this PR does / why we need it:
This PR adds validation for NodePort.Port to ensure ports fall within the cluster's configured ServiceNodePortRange. This prevents late failures during cluster provisioning when the control-plane-operator rejects ports outside the acceptable range.
The problem: When creating a hosted cluster with NodePort set to values like 10000, the creation fails because the port is outside the acceptable range (typically 30000-32767), but this validation only happens late in the process after resources are already created.
The solution:
Which issue(s) this PR fixes:
Fixes https://issues.redhat.com/browse/OCPBUGS-65824
Special notes for your reviewer:
Checklist:
🤖 Generated with Claude Code via
/jira:solve OCPBUGS-65824 origin