CNTRLPLANE-2511: refactor(cpo): move OAuth internal LB annotation into ReconcileService#8185
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe infra reconciler now passes a private-topology flag ( Sequence Diagram(s)(Section intentionally omitted.) Assessment against linked issues
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
4ac6e55 to
2e7ba2e
Compare
|
@bryan-cox: This pull request references CNTRLPLANE-2511 which is a valid jira issue. 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. |
|
@bryan-cox: This pull request references CNTRLPLANE-2511 which is a valid jira issue. 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. |
|
@bryan-cox: This pull request references CNTRLPLANE-2511 which is a valid jira issue. 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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@control-plane-operator/controllers/hostedcontrolplane/oauth/service.go`:
- Around line 74-76: The code only sets
svc.Annotations[azureutil.InternalLoadBalancerAnnotation] when isPrivate is
true, so if a Service was previously private the annotation remains when
reconciling to public; update the reconcile logic in service.go (the block
around svc and isPrivate) to remove/delete
svc.Annotations[azureutil.InternalLoadBalancerAnnotation] when isPrivate is
false (i.e., clear the key instead of leaving it), ensuring the
azureutil.InternalLoadBalancerAnnotation is removed from svc.Annotations; also
add a unit/regression test that seeds a Service with the
azureutil.InternalLoadBalancerAnnotation and then calls the reconcile path with
isPrivate=false and asserts the annotation is absent afterward.
🪄 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), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 64c50a63-0046-43d9-a251-f0f035a4bcd5
📒 Files selected for processing (3)
control-plane-operator/controllers/hostedcontrolplane/infra/infra.gocontrol-plane-operator/controllers/hostedcontrolplane/oauth/service.gocontrol-plane-operator/controllers/hostedcontrolplane/oauth/service_test.go
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8185 +/- ##
=======================================
Coverage 33.11% 33.12%
=======================================
Files 768 768
Lines 93116 93111 -5
=======================================
+ Hits 30840 30841 +1
+ Misses 59665 59660 -5
+ Partials 2611 2610 -1
🚀 New features to boost your workflow:
|
2e7ba2e to
f00054c
Compare
|
@bryan-cox: This pull request references CNTRLPLANE-2511 which is a valid jira issue. 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. |
Move the Azure internal LoadBalancer annotation logic from infra.go into oauth.ReconcileService(), co-locating all service configuration in one place. Also reverts the unnecessary switch refactor back to a simple if check. Addresses review feedback from openshift#8149. JIRA: CNTRLPLANE-2511 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f00054c to
5b79e4f
Compare
|
@bryan-cox: This pull request references CNTRLPLANE-2511 which is a valid jira issue. 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. |
|
/lgtm |
|
Scheduling tests matching the |
|
/verified later @xiuwang This can be verified with the previous PR for CNTRLPLANE-2511 |
|
@bryan-cox: This PR has been marked to be verified later by 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. |
Test Resultse2e-aws
e2e-aks
|
|
/retest |
|
@bryan-cox: all tests passed! 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:
Addresses review feedback from @muraee on #8149:
Moves the Azure internal LoadBalancer annotation (
service.beta.kubernetes.io/azure-load-balancer-internal) frominfra.gointooauth.ReconcileService(), co-locating all OAuth service configuration in one place. This follows the same pattern used bykas.ReconcileService().Reverts the unnecessary
switchrefactor on the strategy type check back to the originalif serviceStrategy.Type != hyperv1.Routeform, since the switch didn't change behavior.Adds behavioral unit tests for the new
isPrivateparameter:Which issue(s) this PR fixes:
Fixes #8149 (review feedback)
Special notes for your reviewer:
Follow-up to #8149. The
ReconcileServicefunction gains anisPrivate boolparameter so the ILB annotation logic can live alongside all other service configuration rather than being split acrossinfra.goandoauth/service.go.Checklist:
Summary by CodeRabbit