hashicorp / hashicorp/nomad

CLI displays reports host_network configuration and not fingerprint

Open
#11,671 3 comments 0 reactions 0 assignees View on GitHub
theme/cli theme/networking type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Nomad v1.2.2 (78b8c171a211f967a8b297a88a7e844b3543f2b0)

### Operating system and Environment details
Linux x64 (mix of RHEL and Alpine)

### Issue
The documented behaviour at https://www.nomadproject.io/docs/configuration/client#host_network-stanza doesn't appear to be what happens in practice:

```Specifies a cidr block of addresses to match against. If an address is found on the node that is contained by this cidr block, the host network will be registered with it.```

### Reproduction steps
On a host with eth0 having an IP of 10.1.2.52 and no other interfaces (except the default loopback/etc)

With the following Nomad client config:

```
client {
host_network "default" {
interface = "eth0"
}
host_network "test1" {
cidr = "10.1.1.0/24"
}
host_network "test2" {
cidr = "10.1.2.0/24"
}
host_network "test3" {
cidr = "10.1.3.0/24"
}
}
```

Doing a `node status -verbose ` results in the following output:

```
Host Networks
Name CIDR Interface ReservedPorts
default eth0
test1 10.1.1.0/24
test2 10.1.2.0/24
test3 10.1.3.0/24
```

#### Expected Result
I would have expected only "default" and "test2" host networks to appear.

#### Actual Result
All networks from the config file appear.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the client host_network configuration and the `node status -verbose ` command described in the reproduction. Reproduce the output using the documented CIDR matching behavior, then trace how configured host networks are selected and displayed. Done means only the interface-backed and CIDR-matching networks appear in the Host Networks output.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.