-
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
Add consul segment fingerprint #7214
Add consul segment fingerprint #7214
Conversation
Hi! Any updates about this ? |
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.
Thank you so much for your contribution. It does make sense to include this value indeed.
Confirmed that segment
is added to Consul 1.0.0, which was released in Oct 2017: hashicorp/consul@b1a15e0 . Prior to that, the self endpoint still contained Members.Tag
but have nil segment. Versions prior to 0.8 don't work on my environment.
client/fingerprint/consul.go
Outdated
@@ -81,6 +81,11 @@ func (f *ConsulFingerprint) Fingerprint(req *FingerprintRequest, resp *Fingerpri | |||
} else { | |||
f.logger.Warn("unable to fingerprint consul.datacenter") | |||
} | |||
if g, ok := info["Member"]["Tags"]["segment"].(string); ok { |
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.
This has a compile error now - update and we can merge. Thanks!
…-segment-fingerprint
Ok! Updated |
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.
Looks like there's still a compile error on this:
==> Linting source code...
WARN [runner] Can't run linter goanalysis_metalinter: ineffassign: analysis skipped: errors in package: [/go/src/github.com/hashicorp/nomad/client/fingerprint/consul.go:84:14: invalid operation: cannot index info["Member"]["Tags"] (map index expression of type interface{})]
ERRO Running error: ineffassign: analysis skipped: errors in package: [/go/src/github.com/hashicorp/nomad/client/fingerprint/consul.go:84:14: invalid operation: cannot index info["Member"]["Tags"] (map index expression of type interface{})]
…-segment-fingerprint
I hadn't noticed that new commits came in to get this green, thanks for those @daktari and sorry about the delay. LGTM! |
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 allows to add consul segment attribute to nomad clients.
BR