-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feature(config): Add go-sockaddr templating support to nomad consul address #12084
feature(config): Add go-sockaddr templating support to nomad consul address #12084
Conversation
8466c40
to
c7880b9
Compare
Hi @Nkmol . Thanks for contributing! I'm going to take a look today and talk to the team about your contribution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found one thing right away that is a blocker. See comment about panic.
c7880b9
to
a092991
Compare
a092991
to
a7683f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Nkmol! Thanks for this PR, this is looking really good. I've left a few comments but once those are resolved I imagine we can get this shipped as part of Nomad 1.3.0
If you'd like, you can add a changelog file too. That'd be a text file at .changelog/12084.txt
formatted similar to .changelog/12079.txt.
a7683f1
to
7f4e241
Compare
Thanks @shoenig and @tgross for the thorough review. Based on the feedback, I changed the following:
|
7f4e241
to
5a5518c
Compare
056feaf
to
856fdcc
Compare
856fdcc
to
9d134ab
Compare
9d134ab
to
878f6e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'll get this merged once CI is done and it'll ship in Nomad 1.3.0. Thanks again @Nkmol!
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. |
This PR adds support for go-sockaddr/template in the consul address Stanza.
As noted in the issue, this becomes especially useful when you want to pair your nomad agent to the consul private network agent in a dynamic fashion.
Fixes: #11062
Special note to the reviewer
A check has been added to only support one single IP in the Stanza, as was done in other places using
ParseSingleIPTemplate
. However, I think in the years Hashicorp defines this in their shared package: https://github.com/hashicorp/go-secure-stdlib/blob/7166b1cdf6a6eb1311247e34feae17eaf7b657bf/listenerutil/parse.go#L374Adding an extra dependency to the repo of go-secure-stdlib might not be something preferable. If this is still preferable, I could add this extra import.
This is my first contribution to this project and the first time touching Go, so any tips or directions for improvement is always welcome :)