Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 'default' alias not added to interface specified by network_interface #18096

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

kevinschoonover
Copy link
Contributor

@kevinschoonover kevinschoonover commented Jul 29, 2023

closes #18097

consider the following config.hcl

# config.hcl
client {
  network_interface = "tailscale0"

  host_network "tailscale" {
    interface = "tailscale0"
  }

  host_network "public" {
    interface = "wlan0"
  }
}

whenever you would schedule the following job

# job.hcl
job "docs" {
  datacenters = ["dc1"]

  group "example" {
    network {
      port "http" {}
    }
    task "server" {
      driver = "docker"

      config {
        image = "hashicorp/http-echo"
        ports = ["http"]
        args = [
          "-listen",
          ":5678",
          "-text",
          "hello world",
        ]
      }
    }
  }
}

you would see * Constraint "missing host network \"default\" for port \"http\"": 1 nodes excluded by filter because the 'default' host_network alias is being replaces with 'tailscale'. The follow PR appends the 'default' alias regardless to the addresses specified by network_interface.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work on this @kevinschoonover!

Two things:

@tgross tgross moved this from Triaging to In Progress in Nomad - Community Issues Triage Jul 31, 2023
@tgross tgross added theme/fingerprint backport/1.4.x backport to 1.4.x release line backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line type/bug labels Jul 31, 2023
@tgross tgross added this to the 1.6.x milestone Jul 31, 2023
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM! This will ship in the next Nomad 1.6.x release and get backported to 1.5.x and 1.4.x

@tgross tgross merged commit 4841791 into hashicorp:main Aug 1, 2023
22 of 23 checks passed
Nomad - Community Issues Triage automation moved this from In Progress to Done Aug 1, 2023
tgross pushed a commit that referenced this pull request Aug 1, 2023
tgross pushed a commit that referenced this pull request Aug 1, 2023
…`network_interface` (#18096) (#18116)

Co-authored-by: Kevin Schoonover <github@kschoon.me>
@kevinschoonover kevinschoonover deleted the kschoon/multi-alias-default branch August 2, 2023 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.4.x backport to 1.4.x release line backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line stage/waiting-reply theme/fingerprint theme/networking type/bug
Projects
Development

Successfully merging this pull request may close these issues.

'default' host_network isn't found when same interface is specified under named host_network
2 participants