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

Golang client API client is missing support for TaggedAddresses #2273

Closed
pradeepnss opened this issue Aug 15, 2016 · 2 comments · Fixed by #2280
Closed

Golang client API client is missing support for TaggedAddresses #2273

pradeepnss opened this issue Aug 15, 2016 · 2 comments · Fixed by #2280
Assignees
Labels
type/enhancement Proposed improvement or new feature

Comments

@pradeepnss
Copy link

pradeepnss commented Aug 15, 2016

consul version for both Client and Server

Client: 0.6.4
Server: 0.6.4

Description of the Issue (and unexpected/desired result)

When we query nodes in datacenter using consul http api (http://localhost:8500/v1/catalog/nodes) we can see the advertise wan ip as part of the output.

But when we use the Golang client api and call the method "Catalog().Nodes()" we can only see the Node name and ip address but remaining information along with advertise wan ip is missing.

Reason for this is the node struct used in the Catalog.go which is as below:

type Node struct {
    Node    string
    Address string
}

But if we check the structs.go under consul/structs, we find the correct node struct:

type Node struct {
    Node            string
    Address         string
    TaggedAddresses map[string]string

    RaftIndex
}

Question is posted on consul google forum (https://groups.google.com/forum/#!topic/consul-tool/sqe_o3J2A7w) and it is confirmed by James Phillip that it was just an oversight.

@slackpad slackpad added the type/enhancement Proposed improvement or new feature label Aug 16, 2016
@slackpad slackpad self-assigned this Aug 16, 2016
@slackpad
Copy link
Contributor

I'll take this one. I also realized that after #2275 there's no way to get the LAN address if translation is turned on, so I'll add a "lan" tag as well as part of this change.

@slackpad slackpad changed the title Golang client API output is different to http api when querying for nodes information in a datacenter Golang client API client is missing support for TaggedAddresses Aug 16, 2016
@slackpad
Copy link
Contributor

Also @pradeepnss you may want to take a look at #2275 that may provide what you are looking for without needing to access the tagged addresses directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Proposed improvement or new feature
Projects
None yet
2 participants