OCPBUGS-98571: Exclude ARO HCP from internal LB scope for PublicAndPrivate topology#8993
OCPBUGS-98571: Exclude ARO HCP from internal LB scope for PublicAndPrivate topology#8993zgalor wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@zgalor: This pull request references Jira Issue OCPBUGS-98571, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
📝 WalkthroughWalkthrough
Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zgalor The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/params.go`:
- Around line 51-59: Update the annotation-based loadBalancerScope assignment to
also require !azureutil.IsAroHCPByHCP(hcp), preventing ARO HCP clusters from
receiving InternalLoadBalancer through
hyperv1.IngressControllerLoadBalancerScope. Add a regression test covering an
ARO HCP with that annotation and verify the internal scope is not selected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 0a8afd2c-3bb3-4b1f-9e9b-4d28dea728b8
📒 Files selected for processing (1)
control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/params.go
| // For self-managed Azure clusters, set internal LB scope when topology | ||
| // requires private connectivity. ARO HCP clusters are excluded because | ||
| // they use shared ingress — the guest cluster's ingress operator should | ||
| // not create a per-cluster internal LB that bypasses the shared router. | ||
| if hcp.Spec.Platform.Type == hyperv1.AzurePlatform && hcp.Spec.Platform.Azure != nil && | ||
| !azureutil.IsAroHCPByHCP(hcp) && | ||
| (hcp.Spec.Platform.Azure.Topology == hyperv1.AzureTopologyPrivate || | ||
| hcp.Spec.Platform.Azure.Topology == hyperv1.AzureTopologyPublicAndPrivate) { | ||
| loadBalancerScope = v1.InternalLoadBalancer |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the target file with line numbers.
cat -n control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/params.go | sed -n '1,140p'
# Find related annotation handling and ARO checks.
rg -n "IngressControllerLoadBalancerScope|IsAroHCPByHCP|InternalLoadBalancer|loadBalancerScope" control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress -S
# Look for tests covering this behavior.
rg -n "Aro|ARO|InternalLoadBalancer|IngressControllerLoadBalancerScope|loadBalancerScope" control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress -g '*_test.go' -SRepository: openshift/hypershift
Length of output: 8765
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the parameter tests around the Azure cases and annotation handling.
cat -n control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/params_test.go | sed -n '1,280p'Repository: openshift/hypershift
Length of output: 7906
Apply the ARO guard to the annotation path too.
hcp.Annotations[hyperv1.IngressControllerLoadBalancerScope] == InternalLoadBalancer still sets loadBalancerScope before the Azure/ARO check runs, so an ARO HCP with that annotation can still get the forbidden internal LB scope. Gate the annotation assignment on !azureutil.IsAroHCPByHCP(hcp) as well, and add a regression test for the ARO + annotation case.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/params.go`
around lines 51 - 59, Update the annotation-based loadBalancerScope assignment
to also require !azureutil.IsAroHCPByHCP(hcp), preventing ARO HCP clusters from
receiving InternalLoadBalancer through
hyperv1.IngressControllerLoadBalancerScope. Add a regression test covering an
ARO HCP with that annotation and verify the internal scope is not selected.
…ublicAndPrivate topology ARO HCP clusters use shared ingress and should not have the guest cluster's IngressController set to Internal LB scope when topology is PublicAndPrivate. This adds the same IsAroHCPByHCP guard used in router.go. Note: Testing showed this fix alone does not fully resolve the issue — there appears to be another code path setting Internal scope. This PR is submitted to assist investigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
add1d86 to
d08393d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8993 +/- ##
=======================================
Coverage 43.79% 43.79%
=======================================
Files 772 772
Lines 96037 96046 +9
=======================================
+ Hits 42061 42068 +7
- Misses 51061 51063 +2
Partials 2915 2915
... and 1 file with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/pipeline required |
|
Scheduling tests matching the |
|
/close In favor of the other PR #8992 |
|
@bryan-cox: Closed this PR. DetailsIn response to this:
Instructions 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. |
|
@zgalor: This pull request references Jira Issue OCPBUGS-98571. The bug has been updated to no longer refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@zgalor: This pull request references Jira Issue OCPBUGS-98571, which is valid. 3 validation(s) were run on this bug
The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
Summary
Adds an
IsAroHCPByHCPguard to the HCCO'sparams.goto prevent settingloadBalancerScope=InternalLoadBalanceron ARO HCP clusters withPublicAndPrivatetopology. This matches the existing guard pattern inrouter.go.Problem
When CS sets
topology=PublicAndPrivateon Swift-enabled HostedClusters (as required by the enhancement openshift/enhancements#1985), the HCCO creates the guest cluster's IngressController withloadBalancerScope=Internal. This causes the ingress operator to create a per-cluster internal Azure LB (<infraID>-internal), bypassing the shared ingress router that ARO HCP uses. The*.appsDNS record points to the internal LB private IP (10.0.0.5) instead of the shared ingress public IP, making application routes unreachable externally.Validation
topology=PublicAndPrivateon a personal dev environment-internalLB created at 10.0.0.5, IngressControllerscope: Internalscope: ExternalBug
https://redhat.atlassian.net/browse/OCPBUGS-98571
References
router.go(existing ARO HCP guard):control-plane-operator/controllers/hostedcontrolplane/ingress/router.goline 48