Skip to content

OCPBUGS-120711: Fix vsphere network absolute paths - #6497

Open
pablintino wants to merge 1 commit into
openshift:mainfrom
pablintino:ocpbugs-120711
Open

OCPBUGS-120711: Fix vsphere network absolute paths#6497
pablintino wants to merge 1 commit into
openshift:mainfrom
pablintino:ocpbugs-120711

Conversation

@pablintino

@pablintino pablintino commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Closes: #OCPBUGS-120711

- What I did

Despite the API docs says that the networks should be in an absolute format, our code and CI was using the relative name of the network and performing some string joinning to make the path absolute before delegating the call to the vmware lib.
Given that the underlaying vmware library properly handles all the formats this change removes the path manling and passes the name directly to the library like other operators do.

- How to verify it

TBD

- Description for the changelog

Fix vsphere network name handling to allow absolute names, that are the oficailly supported ones.

Summary by CodeRabbit

  • Bug Fixes
    • Improved vSphere network resource discovery for failure domains.
    • Network identifiers in finder-supported formats are now handled directly, improving compatibility with supported network references.
    • Existing network lookup error reporting remains unchanged.

Despite the API docs says that the networks should be in an absolute
format, our code and CI was using the relative name of the network and
performing some string joinning to make the path absolute before
delegating the call to the vmware lib.
Given that the underlaying vmware library properly handles all the
formats this change removes the path manling and passes the name
directly to the library like other operators do.

Signed-off-by: Pablo Rodriguez Nava <git@amail.pablintino.eu>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pablintino: This pull request references Jira Issue OCPBUGS-120711, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "5.0.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Closes: #OCPBUGS-120711

- What I did

Despite the API docs says that the networks should be in an absolute format, our code and CI was using the relative name of the network and performing some string joinning to make the path absolute before delegating the call to the vmware lib.
Given that the underlaying vmware library properly handles all the formats this change removes the path manling and passes the name directly to the library like other operators do.

- How to verify it

TBD

- Description for the changelog

Fix vsphere network name handling to allow absolute names, that are the oficailly supported ones.

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

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 189cac74-cd08-45b7-8cab-dd2706396405

📥 Commits

Reviewing files that changed from the base of the PR and between 11fd0ff and 1129129.

📒 Files selected for processing (1)
  • pkg/controller/bootimage/vsphere_helpers.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

Network discovery now passes the failure-domain network identifier directly to finder.Network. The previous cluster inventory-path construction was removed.

Changes

vSphere network discovery

Layer / File(s) Summary
Direct network finder lookup
pkg/controller/bootimage/vsphere_helpers.go
findAllRequiredResources passes the original failure-domain network value to finder.Network. Network lookup error handling remains unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 11291

Network discovery now passes the configured vSphere network identifier directly to the VMware finder, enabling supported network-name formats while retaining lookup error handling. No merge-blocking risk is identified.

Suggested reviewers: djoshy

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the tracked issue and the main change: fixing vSphere network absolute path handling.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
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 PASS. The pull request changes only pkg/controller/bootimage/vsphere_helpers.go and does not add or modify any Ginkgo test title. The changed code only passes failureDomain.Topology.Networks[0] to…
Test Structure And Quality ✅ Passed PASS: The pull request changes only pkg/controller/bootimage/vsphere_helpers.go and does not add or modify any Ginkgo test code. Therefore, the stated test-quality requirements are not applicable to…
Microshift Test Compatibility ✅ Passed The pull request changes only pkg/controller/bootimage/vsphere_helpers.go and adds no Ginkgo e2e tests. The MicroShift Test Compatibility check therefore does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request changes only pkg/controller/bootimage/vsphere_helpers.go. The diff updates vSphere network lookup and adds no Ginkgo tests or test constructs such as It(), Describe(), `Context(…
Topology-Aware Scheduling Compatibility ✅ Passed PASS — The pull request changes only pkg/controller/bootimage/vsphere_helpers.go. The diff replaces the constructed vSphere network path with the direct failureDomain.Topology.Networks[0] argument…
Ote Binary Stdout Contract ✅ Passed PASS — The pull request changes only the vSphere network lookup in pkg/controller/bootimage/vsphere_helpers.go. The new code passes failureDomain.Topology.Networks[0] directly to finder.Network
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS. The pull request changes only pkg/controller/bootimage/vsphere_helpers.go. The verified commit diff contains no added Ginkgo tests or other test files. Therefore, the IPv4 and external-connect…
No-Weak-Crypto ✅ Passed PASS: The pull request changes only vSphere network lookup in findAllRequiredResources, replacing path.Join(...) with a direct finder.Network(...) call. The diff introduces no MD5, SHA1, DES, RC…
Container-Privileges ✅ Passed PASS. The commit changes only pkg/controller/bootimage/vsphere_helpers.go. The patch changes vSphere network lookup arguments and adds no container or Kubernetes manifest. The added and removed lines …
No-Sensitive-Data-In-Logs ✅ Passed PASS: The pull request adds no logging statement and does not add passwords, tokens, API keys, PII, session IDs, hostnames, or customer data to logs. The only behavior change passes the network identi…
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@pablintino

Copy link
Copy Markdown
Contributor Author

/test e2e-vsphere-mco-bootimages

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 4, 2026
@pablintino

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pablintino: This pull request references Jira Issue OCPBUGS-120711, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pablintino: This pull request references Jira Issue OCPBUGS-120711, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Closes: #OCPBUGS-120711

- What I did

Despite the API docs says that the networks should be in an absolute format, our code and CI was using the relative name of the network and performing some string joinning to make the path absolute before delegating the call to the vmware lib.
Given that the underlaying vmware library properly handles all the formats this change removes the path manling and passes the name directly to the library like other operators do.

- How to verify it

TBD

- Description for the changelog

Fix vsphere network name handling to allow absolute names, that are the oficailly supported ones.

Summary by CodeRabbit

  • Bug Fixes
  • Improved vSphere network resource discovery for failure domains.
  • Network identifiers in finder-supported formats are now handled directly, improving compatibility with supported network references.
  • Existing network lookup error reporting remains unchanged.

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.

@djoshy

djoshy commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

/lgtm

Thank you for the fix!

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-gcp-op-ocl-part1
/test e2e-gcp-op-ocl-part2
/test e2e-gcp-op-part1
/test e2e-gcp-op-part2
/test e2e-gcp-op-single-node
/test e2e-hypershift
/test tls-pqc-readiness

@openshift-ci

openshift-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: djoshy, pablintino

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

The pull request process is described 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

@sergiordlr

Copy link
Copy Markdown
Contributor

While reproducing this issue in our clusters we configured a full path network in the infra failure domains

We were able to reproduce the issue in MCO

E0904 16:39:01.763229       1 ms_helpers.go:98] Error syncing MAPI MachineSet failed to reconcile machineset ci-op-z687tx3t-4899a-jpmvx-worker-1, err: failed to find network: network '/cidatacenter-1/host/cicluster-1/cidatacenter-1/network/ci-vlan-1302-11' not found

But we saw other issues. When we configured the full path a new machine was created by the CPMS, and this machine was using the full path network, and failed.

    conditions:
    - lastTransitionTime: "2026-09-04T16:08:52Z"
      message: 'error getting network specs: unable to get network for "/datacenterX/network/vlan-XX-YY"'
      reason: MachineCreationSucceeded
      status: "False"
      type: MachineCreation

If we configure machinesets to use the full path network too, they will fail too reporting the same error.

This is the AI analysis (it may be wrong) for the failure in the machine-api-operator repo

The bug is in pkg/controller/vsphere/reconciler.go:1365:                                                                                                                                                         
   
  if netSpec.NetworkName == networkName {                                                                                                                                                                          
                                                                                                                                                                                                                   
  ObjectName() returns only the short name (ci-vlan-1302-11), so a full path (/cidatacenter-1/network/ci-vlan-1302-11) will never match.                                                                           
                                                                                                                                                                                                                   
  The fix belongs in the reconciler — it should handle both formats. Something like:                                                                                                                               
                                                                  
  if netSpec.NetworkName == networkName || path.Base(netSpec.NetworkName) == networkName {                                                                                                                         
                                                                                            

@openshift-ci

openshift-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@pablintino: 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-gcp-op-part2 1129129 link true /test e2e-gcp-op-part2
ci/prow/e2e-hypershift 1129129 link true /test e2e-hypershift
ci/prow/perfscale-control-plane-6nodes 1129129 link false /test perfscale-control-plane-6nodes
ci/prow/e2e-aws-ovn 1129129 link true /test e2e-aws-ovn
ci/prow/e2e-gcp-op-ocl-part2 1129129 link true /test e2e-gcp-op-ocl-part2

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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.

4 participants