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

Enable go-sockaddr templating for network-interface #10404

Merged
merged 4 commits into from
Apr 20, 2021

Conversation

angrycub
Copy link
Contributor

This adds go-sockaddr templating for the client.network_interface attribute. @lgfa29 helped me write the tests.

Closes #3675
Fixes #5498

angrycub and others added 3 commits April 19, 2021 18:22
This PR also adds a fast-fail to in the case where an invalid interface is set or produced by the template
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 once the link gets fixed. Take my other comments as suggestions only.

Not sure why the tests didn't run on CircleCI. The new test code passes fine (including a run of all of ./command/agent), and we'll probably get a full run once you push the fix for the link anyways:

$ go test -v ./command/agent -run TestConfig_normalizeAddrs
=== RUN   TestConfig_normalizeAddrs_DevMode
--- PASS: TestConfig_normalizeAddrs_DevMode (0.00s)
=== RUN   TestConfig_normalizeAddrs_NoAdvertise
--- PASS: TestConfig_normalizeAddrs_NoAdvertise (0.00s)
=== RUN   TestConfig_normalizeAddrs_AdvertiseLocalhost
--- PASS: TestConfig_normalizeAddrs_AdvertiseLocalhost (0.00s)
=== RUN   TestConfig_normalizeAddrs_IPv6Loopback
--- PASS: TestConfig_normalizeAddrs_IPv6Loopback (0.00s)
=== RUN   TestConfig_normalizeAddrs
--- PASS: TestConfig_normalizeAddrs (0.01s)
PASS
ok      github.com/hashicorp/nomad/command/agent        0.337s

website/content/docs/configuration/client.mdx Show resolved Hide resolved
command/agent/config.go Show resolved Hide resolved
command/agent/config.go Outdated Show resolved Hide resolved
command/agent/config_test.go Outdated Show resolved Hide resolved
@@ -986,6 +987,103 @@ func TestConfig_normalizeAddrs(t *testing.T) {
}
}

func TestConfig_templateNetworkInterface(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

This is a nice testing improvement!

@angrycub angrycub merged commit 19773e4 into main Apr 20, 2021
@angrycub angrycub deleted the f-template-network-interface branch April 20, 2021 17:55
@tgross tgross added this to the 1.1.0 milestone Apr 20, 2021
@shantanugadgil
Copy link
Contributor

Could this be related to #8169 ?
Any chance of this landing in 1.1.0 ? ☺️

@tgross
Copy link
Member

tgross commented Apr 22, 2021

@shantanugadgil this changset will ship in 1.1.0. #8169 looks like a different field.

@shantanugadgil
Copy link
Contributor

looks like a different field.

Yes, I was making a push/request for the field retry_join for version 1.1.0 😁

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Network fingerprinting on lo client network_interface config doesn't parse sockaddr templates
4 participants