Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tweiers
Copy link
Contributor

@tweiers tweiers commented Sep 16, 2025

Description of the Pull Request (PR):

Currently the netplan overlay assumes that the device name and netdevs name of a network device are the same when creating bonds.
This can cause issues when the netdev name differences from the device name causing the overlay to skip adding the device to the bond.

For example.
A node has the following set:
NetDevs[default].Device: bond0

NetDevs[eth0].Device: eno12399np0
NetDevs[eth0].Tags[master]: bond0

NetDevs[eth1].Device: eno12409np1
NetDevs[eth1].Tags[master]: bond0

Before the if statement would check if the master tag matches the netdev name of the bond.
In this case that would fail as the device name is bond0 but the netdev name is default.
This would cause the interfaces to never get added.

Secondly when check was changed to look at device names instead the interace that would be added would be the netdev name instead of the device name.
This could cause issues with eth0 and eth1 getting added as interfaces but those interfaces don't exist and instead should be the netdev.device names eno12399np0 and eno12409np1.

This fixes or addresses the following GitHub issues:

Reviewer checklist

The reviewer checks the following items before merging the PR.

  • The PR is based on the appropriate branch (typically main)
  • All commits are "Signed off" (e.g., using git commit --signoff) in agreement to the DCO
  • The CHANGELOG has been updated, if necessary, and under the correct release heading
  • The userdocs have been updated, if necessary
  • The submitter is listed in the contributors file
  • The test suite has been updated, if necessary

@tweiers tweiers marked this pull request as ready for review September 16, 2025 20:28
@iankgt40
Copy link
Contributor

iankgt40 commented Sep 16, 2025

This fix needs to go into 01-netcfg.yaml, and I have tested it in the correct file and it does resolve this issue without affecting other functionality.

@anderbubble anderbubble added this to the v4.6.5 milestone Sep 17, 2025
@anderbubble
Copy link
Collaborator

@iankgt40 I don't see a 01-netcfg.yaml in the overlay. Are you saying that it should be introduced in a new file? How do they differ? (I don't know much about netplan.)

@iankgt40
Copy link
Contributor

iankgt40 commented Sep 18, 2025 via email

@anderbubble anderbubble self-requested a review October 14, 2025 19:22
@anderbubble anderbubble self-assigned this Oct 14, 2025
@anderbubble anderbubble force-pushed the netplan-bond-interface-fix branch from 06ca32f to c600a3e Compare October 14, 2025 19:54
@anderbubble
Copy link
Collaborator

I updated the changelog and added testing for this case to the test suite. Just waiting for the tests to complete now.

@anderbubble anderbubble requested a review from Copilot October 14, 2025 19:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue in the netplan overlay where bond interfaces were incorrectly using netdev names instead of device names, causing interfaces to not be properly added to bonds when the netdev name differs from the device name.

  • Fixed bond creation logic to compare against device names instead of netdev names
  • Updated interface addition to use device names rather than netdev names
  • Added comprehensive test coverage for bond configurations

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
overlays/netplan/rootfs/etc/netplan/warewulf.yaml.ww Updated bond creation logic to use device names for proper interface matching
overlays/netplan/internal/netplan_test.go Enhanced test suite with bond configuration scenarios and inline test data
CHANGELOG.md Added entry documenting the bond device name fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@anderbubble anderbubble merged commit c464e10 into warewulf:main Oct 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants