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

Check deregister behavior for consul appears incorrect #57

Closed
AlexCuse opened this issue Oct 2, 2020 · 3 comments · Fixed by #58
Closed

Check deregister behavior for consul appears incorrect #57

AlexCuse opened this issue Oct 2, 2020 · 3 comments · Fixed by #58

Comments

@AlexCuse
Copy link

AlexCuse commented Oct 2, 2020

Looking at the consul docs for check registration (https://www.consul.io/api-docs/agent/check#register-check) It looks like they take both a ServiceID and an ID property. If the ID is not provided, it defaults to the check name.

Deregister then takes the ID (name) as input, where here we pass the service key (ServiceID).

If you inspect the check in the consul UI you can see the check ID as something like "Health Check: edgex-core-command", and I have confirmed I need to run curl -X PUT edgex-core-consul:8500/v1/agent/check/deregister?check_id=Health%20Check%3A%20edgex-core-command to deregister a check

I am not sure if it is preferable here to use an explicit ID to register, to just deregister using the name, or to register using the service key as the ID.

@AlexCuse
Copy link
Author

AlexCuse commented Oct 2, 2020

For what its worth I would favor some kind of explicit calculated id like {serviceKey}-edgex-health but I am working on extending the client to allow registering additional checks so I am considerably biased towards something that may not end up viable. Happy to submit any kind of fix for this in the meantime though.

@lenny-goodell
Copy link
Member

Agreed that the CheckId should also be set serviceKey when we register. Not sure why we need to append anything to the serviceKey.

BTW, all my testing shows it deregister just fine. This may be because we are deregistering the whole service as well as the check.

@AlexCuse
Copy link
Author

AlexCuse commented Oct 6, 2020

Yeah I think the service deregister might "cascade" and take care of it anyway. I'm looking to be able to add and remove health checks on the fly (without deregistering service) so need to make sure check deregister works there. Service key ought to work fine I will try and get a PR sent for that today.

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 a pull request may close this issue.

2 participants