Skip to content

AGENT-626: Allow UserManaged LoadBalancer on baremetal/vsphere platforms#10558

Open
zaneb wants to merge 2 commits into
openshift:mainfrom
zaneb:external-lb-agent
Open

AGENT-626: Allow UserManaged LoadBalancer on baremetal/vsphere platforms#10558
zaneb wants to merge 2 commits into
openshift:mainfrom
zaneb:external-lb-agent

Conversation

@zaneb
Copy link
Copy Markdown
Member

@zaneb zaneb commented May 18, 2026

Map the LoadBalancer type from platform install-config (baremetal,
vsphere) through to the AgentClusterInstall spec. The configv1
PlatformLoadBalancerType is converted to the hiveext
LoadBalancerType (UserManaged -> UserManaged,
OpenShiftManagedDefault -> ClusterManaged).

Remove the "is ignored" warning for LoadBalancer on the vsphere
platform, since the field is now plumbed through.

Note that in Assisted Service, the UserManaged LoadBalancer is not currently supported with Nutanix.

Summary by CodeRabbit

  • New Features

    • Platform-specific load balancer handling for agent-based BareMetal and vSphere installs with type mapping.
  • Bug Fixes

    • Removed an inaccurate warning about load balancer being ignored for agent-based vSphere installs.
  • Documentation

    • Removed TechPreview note and simplified load balancer field descriptions across BareMetal, Nutanix, oVirt, and vSphere CRD/docs.
  • Tests

    • Added test cases covering user-managed load balancer scenarios for BareMetal and vSphere.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 18, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 18, 2026

@zaneb: This pull request references AGENT-626 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Map the LoadBalancer type from platform install-config (baremetal,
vsphere) through to the AgentClusterInstall spec. The configv1
PlatformLoadBalancerType is converted to the hiveext
LoadBalancerType (UserManaged -> UserManaged,
OpenShiftManagedDefault -> ClusterManaged).

Remove the "is ignored" warning for LoadBalancer on the vsphere
platform, since the field is now plumbed through.

Note that in Assisted Service, the UserManaged LoadBalancer is not currently supported with Nutanix.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Walkthrough

Propagate platform LoadBalancer into AgentClusterInstall for BareMetal and vSphere, add a mapping helper for load balancer types, remove the obsolete vSphere agent warning, and remove TechPreview notes from LoadBalancer field docs and CRD descriptions.

Changes

LoadBalancer graduation and agent support

Layer / File(s) Summary
Platform type documentation updates
pkg/types/baremetal/platform.go, pkg/types/nutanix/platform.go, pkg/types/ovirt/platform.go, pkg/types/vsphere/platform.go, data/data/install.openshift.io_installconfigs.yaml
TechPreview notes removed and descriptions reformatted for LoadBalancer across BareMetal, Nutanix, oVirt, and vSphere in types and the installconfig CRD; field declarations unchanged.
AgentClusterInstall LoadBalancer wiring
pkg/asset/agent/manifests/agentclusterinstall.go, pkg/asset/agent/manifests/agentclusterinstall_test.go
BareMetal and vSphere platform loadBalancer blocks are propagated into AgentClusterInstall.Spec.LoadBalancer.Type. Adds loadBalancerType helper to map configv1.PlatformLoadBalancerType to hiveext.LoadBalancerType (UserManaged -> UserManaged; otherwise -> ClusterManaged). Tests and fixtures added for user-managed cases.
Remove obsolete LoadBalancer validation warning
pkg/asset/agent/installconfig.go
Remove the vSphere-specific check/warning that reported non-default loadBalancer values as ignored for agent-based installs.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: enabling UserManaged LoadBalancer support on baremetal and vsphere platforms, which aligns with the primary objective of the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR only modifies agentclusterinstall_test.go which uses standard Go testing with table-driven tests (testing.T and t.Run), not Ginkgo. The check is not applicable.
Test Structure And Quality ✅ Passed Custom check is for Ginkgo test structure (It blocks, BeforeEach/AfterEach), but this repo uses standard testing.T with table-driven tests, not Ginkgo. Check not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in this PR. The only test changes are in agentclusterinstall_test.go, which is a standard Go unit test file (using testing package), not Ginkgo-based e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds Go unit tests to agentclusterinstall_test.go, not Ginkgo e2e tests. Check applies only to new Ginkgo e2e tests with It(), Describe(), Context() patterns.
Topology-Aware Scheduling Compatibility ✅ Passed PR introduces no pod scheduling constraints. Changes only map LoadBalancer config to AgentClusterInstall—no affinity, node selectors, or topology constraints.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes added. All logrus calls are within regular functions, not main/init/TestMain. New helper is pure mapping logic. Tests use standard Go framework.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds unit tests only (standard Go testing package), not Ginkgo e2e tests. Check for IPv6/disconnected network compatibility in Ginkgo e2e tests is not applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from bkhizgiy and dtantsur May 18, 2026 02:59
@zaneb zaneb force-pushed the external-lb-agent branch from 38dac57 to 0af0ebb Compare May 18, 2026 03:21
@zaneb
Copy link
Copy Markdown
Member Author

zaneb commented May 18, 2026

CI jobs couldn't obtain a machine to run on.
/retest

@zaneb
Copy link
Copy Markdown
Member Author

zaneb commented May 19, 2026

/retest
/cc @bfournie

@openshift-ci openshift-ci Bot requested a review from bfournie May 19, 2026 03:52
@bfournie
Copy link
Copy Markdown
Contributor

/lgtm
Would be good to add a unit test to agentclusterinstall_test.go

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 19, 2026
zaneb added 2 commits May 20, 2026 09:01
Map the LoadBalancer type from platform install-config (baremetal,
vsphere) through to the AgentClusterInstall spec. The configv1
PlatformLoadBalancerType is converted to the hiveext
LoadBalancerType (UserManaged -> UserManaged,
OpenShiftManagedDefault -> ClusterManaged).

Remove the "is ignored" warning for LoadBalancer on the vsphere
platform, since the field is now plumbed through.

Assisted-by: Claude Code
The LoadBalancer feature was promoted to GA for baremetal and vsphere in
4.16 (OPNET-476). The feature gate check was removed by
f5811d9 but the "available in
TechPreview" comments in the platform type definitions were left behind.

Assisted-by: Claude Code
@zaneb zaneb force-pushed the external-lb-agent branch from 0af0ebb to 5672532 Compare May 19, 2026 23:14
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 19, 2026
@zaneb
Copy link
Copy Markdown
Member Author

zaneb commented May 19, 2026

Now with unit tests.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from bfournie. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pkg/asset/agent/manifests/agentclusterinstall_test.go (1)

165-193: ⚡ Quick win

Add an explicit OpenShiftManagedDefault -> ClusterManaged mapping test case.

Great coverage for UserManaged. Since this PR also introduces OpenShiftManagedDefault -> ClusterManaged, add at least one explicit case (ideally for both BareMetal and vSphere) so both mapper branches are locked by tests.

Proposed test extension
+	installConfigBaremetalClusterManagedLB := getValidOptionalInstallConfig()
+	installConfigBaremetalClusterManagedLB.Config.Platform.BareMetal.LoadBalancer = &configv1.BareMetalPlatformLoadBalancer{
+		Type: configv1.LoadBalancerTypeOpenShiftManagedDefault,
+	}
+
+	goodBaremetalClusterManagedLBACI := getGoodACI()
+	goodBaremetalClusterManagedLBACI.Spec.LoadBalancer = &hiveext.LoadBalancer{
+		Type: hiveext.LoadBalancerTypeClusterManaged,
+	}
...
+		{
+			name: "valid configuration baremetal cluster-managed load balancer",
+			dependencies: []asset.Asset{
+				&workflow.AgentWorkflow{Workflow: workflow.AgentWorkflowTypeInstall},
+				installConfigBaremetalClusterManagedLB,
+				&agentconfig.AgentHosts{},
+				&agentconfig.AgentConfig{},
+			},
+			expectedConfig: goodBaremetalClusterManagedLBACI,
+		},

Also applies to: 370-389

🤖 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 `@pkg/asset/agent/manifests/agentclusterinstall_test.go` around lines 165 -
193, Add explicit test cases mirroring the existing UserManaged ones that
exercise the new OpenShiftManagedDefault -> ClusterManaged mapping: create an
install config via getValidOptionalInstallConfig and set its
Platform.BareMetal.LoadBalancer.Type to the OpenShiftManagedDefault variant (and
a separate one for VSphere.Platform.LoadBalancer.Type), then create
corresponding ACI objects via getGoodACI but set expected fields (e.g.,
goodBaremetal...ACI and goodVSphere...ACI) so the test asserts the mapper
converts OpenShiftManagedDefault to the hiveext.LoadBalancerTypeClusterManaged
result; place these new cases alongside the existing
goodBaremetalUserManagedLBACI and goodVSphereUserManagedLBACI cases to lock both
mapper branches.
🤖 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.

Nitpick comments:
In `@pkg/asset/agent/manifests/agentclusterinstall_test.go`:
- Around line 165-193: Add explicit test cases mirroring the existing
UserManaged ones that exercise the new OpenShiftManagedDefault -> ClusterManaged
mapping: create an install config via getValidOptionalInstallConfig and set its
Platform.BareMetal.LoadBalancer.Type to the OpenShiftManagedDefault variant (and
a separate one for VSphere.Platform.LoadBalancer.Type), then create
corresponding ACI objects via getGoodACI but set expected fields (e.g.,
goodBaremetal...ACI and goodVSphere...ACI) so the test asserts the mapper
converts OpenShiftManagedDefault to the hiveext.LoadBalancerTypeClusterManaged
result; place these new cases alongside the existing
goodBaremetalUserManagedLBACI and goodVSphereUserManagedLBACI cases to lock both
mapper branches.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7179b50f-a44e-41fd-94a2-a72ef08b1304

📥 Commits

Reviewing files that changed from the base of the PR and between 0af0ebb and 5672532.

📒 Files selected for processing (8)
  • data/data/install.openshift.io_installconfigs.yaml
  • pkg/asset/agent/installconfig.go
  • pkg/asset/agent/manifests/agentclusterinstall.go
  • pkg/asset/agent/manifests/agentclusterinstall_test.go
  • pkg/types/baremetal/platform.go
  • pkg/types/nutanix/platform.go
  • pkg/types/ovirt/platform.go
  • pkg/types/vsphere/platform.go
💤 Files with no reviewable changes (5)
  • pkg/types/nutanix/platform.go
  • pkg/types/vsphere/platform.go
  • pkg/types/baremetal/platform.go
  • pkg/types/ovirt/platform.go
  • pkg/asset/agent/installconfig.go
✅ Files skipped from review due to trivial changes (1)
  • data/data/install.openshift.io_installconfigs.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/asset/agent/manifests/agentclusterinstall.go

@bfournie
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 20, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

@zaneb: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-vsphere-ovn-hybrid-env 5672532 link false /test e2e-vsphere-ovn-hybrid-env
ci/prow/e2e-agent-compact-ipv4-appliance-diskimage 5672532 link false /test e2e-agent-compact-ipv4-appliance-diskimage
ci/prow/e2e-vsphere-ovn-zones 5672532 link false /test e2e-vsphere-ovn-zones
ci/prow/e2e-agent-two-node-fencing-ipv4 5672532 link false /test e2e-agent-two-node-fencing-ipv4
ci/prow/e2e-nutanix-ovn 5672532 link false /test e2e-nutanix-ovn
ci/prow/e2e-metal-single-node-live-iso 5672532 link false /test e2e-metal-single-node-live-iso
ci/prow/e2e-metal-ovn-two-node-fencing 5672532 link false /test e2e-metal-ovn-two-node-fencing
ci/prow/e2e-vsphere-ovn-devpreview 5672532 link false /test e2e-vsphere-ovn-devpreview

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants