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

Add consul segment fingerprint #7214

Merged
merged 5 commits into from
Oct 2, 2020

Conversation

daktari
Copy link
Contributor

@daktari daktari commented Feb 21, 2020

This PR allows to add consul segment attribute to nomad clients.

BR

@hashicorp-cla
Copy link

hashicorp-cla commented Feb 21, 2020

CLA assistant check
All committers have signed the CLA.

@daktari
Copy link
Contributor Author

daktari commented May 14, 2020

Hi! Any updates about this ?

Copy link
Contributor

@notnoop notnoop left a 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.

@@ -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 {
Copy link
Contributor

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!

@daktari
Copy link
Contributor Author

daktari commented Aug 3, 2020

Ok! Updated

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.

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{})] 

@tgross
Copy link
Member

tgross commented Oct 2, 2020

I hadn't noticed that new commits came in to get this green, thanks for those @daktari and sorry about the delay. LGTM!

@tgross tgross merged commit 5fd9f1b into hashicorp:master Oct 2, 2020
@tgross tgross added this to the 0.13 milestone Oct 2, 2020
fredrikhgrelland pushed a commit to fredrikhgrelland/nomad that referenced this pull request Oct 22, 2020
@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 Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants