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

added check for consul tag #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vectorhacker
Copy link

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

@@ -73,7 +96,7 @@ func (cw *ConsulWatcher) Next() ([]*naming.Update, error) {
// queryConsul is helper function to query 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
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