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

Fixed merging consul config #2159

Merged
merged 2 commits into from
Jan 19, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nomad/structs/config/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func (a *ConsulConfig) Merge(b *ConsulConfig) *ConsulConfig {
if b.ClientServiceName != "" {
result.ClientServiceName = b.ClientServiceName
}
if b.AutoAdvertise {
result.AutoAdvertise = true
if !b.AutoAdvertise {
Copy link
Contributor

Choose a reason for hiding this comment

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

All the booleans in the config really need to be updated to this style: https://github.com/hashicorp/nomad/blob/master/nomad/structs/config/vault.go#L26

The difference is that by making it a pointer we can tell if the user set it. This gives us three states: unset, false, true. If it is Unset we use the default and if not use what ever is set.

https://github.com/hashicorp/nomad/blob/master/nomad/structs/config/vault.go#L132

result.AutoAdvertise = false
}
if b.Addr != "" {
result.Addr = b.Addr
Expand Down