Skip to content

added check for consul tag#16

Open
vectorhacker wants to merge 1 commit intowothing:masterfrom
vectorhacker:master
Open

added check for consul tag#16
vectorhacker wants to merge 1 commit intowothing:masterfrom
vectorhacker:master

Conversation

@vectorhacker
Copy link
Copy Markdown

Here I've added code to check for the tag of a service in consul.

func (cw *ConsulWatcher) queryConsul(q *consul.QueryOptions) ([]string, uint64, error) {
// query consul
cs, meta, err := cw.cc.Health().Service(cw.cr.ServiceName, "", true, q)
cs, meta, err := cw.cc.Health().Service(cw.name(), cw.tag(), true, q)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@vectorhacker

If service is v1.hello_sever

It registered in consul as v1. hello_sever-ip-port

Your changes break the law. The service you found now becoming hello_sever not v1. hello_sever

It looks like you forgot to handle the consul Register.

https://github.com/wothing/wonaming/blob/master/consul/register.go#L22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants