Skip to content

Conversation

@hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #26910 to be assessed for backporting due to the inclusion of the label backport/1.10.x.

The below text is copied from the body of the original PR.


Description

Fix a regression introduced in Nomad 1.9.0-beta.1 where CNI bridge networking with IPv6-only interfaces would fail with the error failed to configure network: no interface with an address.

The issue was that while the code correctly populated the AddressIPv6 field for IPv6 addresses, several validation checks only examined the Address field (IPv4), causing IPv6-only configurations to be incorrectly rejected. This affected users running IPv6-only infrastructure who were unable to upgrade from Nomad 1.8.x to 1.9.x.

This PR updates the validation logic in four locations to check both IPv4 and IPv6 address fields:

  • Interface selection logic in cniToAllocNet() - now accepts interfaces with either IPv4 or IPv6 addresses
  • Fallback logic - checks both Address and AddressIPv6 before falling back
  • Error check - only fails when both IPv4 and IPv6 are missing
  • AllocNetworkStatus.IsZero() - includes AddressIPv6 in the zero check

Testing & Reproduction steps

Reproduction (without fix):

  1. Set up a CNI bridge interface with only IPv6 addresses (no IPv4)
  2. Configure Nomad client to use bridge networking
  3. Run any job with network { mode = "bridge" }
  4. Observe the error: failed to configure network: no interface with an address

Testing:

  • Added new test TestCNI_cniToAllocNet_IPv6Only that verifies CNI results with only IPv6 addresses are handled correctly
  • The test follows the same pattern as the existing TestCNI_cniToAllocNet_Dualstack test
  • Existing dual-stack test continues to pass, ensuring no regression for IPv4+IPv6 configurations

Links

Fixes #26905

Related:

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge" in the majority of situations. The main exceptions are long-lived feature branches or merges where history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry within the public repository.
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

No changes to security controls. This is a bug fix that restores correct validation logic for network interface address checking.


Overview of commits

@tgross tgross merged commit 6257427 into release/1.10.x Oct 13, 2025
30 checks passed
@tgross tgross deleted the backport/main/properly-mint-seahorse branch October 13, 2025 20:28
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