-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
checkid vs id parameter issue #7566
Comments
From my reading #6874 does not appear to be the cause. I did a bit of digging and here is what I found. Both the HTTP API endpoint and config file expect consul/agent/structs/check_definition.go Lines 12 to 13 in 5c1858e
Lines 415 to 416 in 5c1858e
The Lines 179 to 185 in 5c1858e
In this case the ID field is correct. The part that may be broken is the service config, which uses CheckID Line 191 in 5c1858e
This struct is translated into an api.AgentServiceRegistration using mapstructure, but from what I can see there is nothing telling it to map I suspect this is breaking adding checks from I also haven't found the message which reports that This seems to match the conclusion in #7395 So the Check API is correct, but registering checks a check with an ID as part of a service is broken. |
I suspect part of the confusion here is that the CheckDefinition (which uses ID) produces a CheckType (which uses CheckID). We should probably be consistent. We may need to copy the field for API responses to prevent breaking API integrations. |
#6923 is an issue with the same cause on a different field. Converting from one type to another when the fields do not match properly. |
In the mean time, even though G-Research/consuldotnet#185 states that ID is obsolete and CheckID should be used, the documentation here: https://developer.hashicorp.com/consul/api-docs/agent/check#register-check still tells us to use the ID field (and v1.16.1 returns an error if ID is actually used, which seems to be a regression). |
@jsosulska this issue doesn't seem to be getting much attention anymore but in the mean time the published documentation is pain wrong and at least that should be pretty easy to fix? |
Apparently there is some confusion around registering a check. This issue collects the data, issues and PRs around that so that we can decide what to do.
Maybe related:
Possible root causes:
Action items:
consul services register
documented in the comment belowThe text was updated successfully, but these errors were encountered: