-
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
Replace "-" in port labels with "_" for env vars #2406
Conversation
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.
Website documentation
client/driver/env/env.go
Outdated
@@ -147,6 +147,8 @@ func (t *TaskEnvironment) Build() *TaskEnvironment { | |||
// Build the ports | |||
for _, network := range t.Networks { | |||
for label, value := range network.MapLabelToValues(nil) { | |||
// Replace dashes with underscores #2405 | |||
label = strings.Replace(label, "-", "_", -1) |
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 would just move this to the bottom and go through all keys and sanitize them.
45579c8
to
a9e3f2c
Compare
</table> | ||
|
||
Port labels and task names will have any dashes `-` in their names replaced by |
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.
~> Port labels and task names will have any dashes `-` in their names replaced by
underscores `_` when they're used in environment variable names such as
`NOMAD_ADDR_<task>_<label>`.
This will make it a popped out bubble to draw attention. See yellow box: https://www.consul.io/docs/guides/outage.html
Up to you to include.
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. |
Fixes #2405