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

Error in status validation when registering service w/ health check #1775

Closed
shilov opened this issue Mar 1, 2016 · 1 comment
Closed

Error in status validation when registering service w/ health check #1775

shilov opened this issue Mar 1, 2016 · 1 comment
Labels
type/enhancement Proposed improvement or new feature

Comments

@shilov
Copy link
Contributor

shilov commented Mar 1, 2016

The API client returns an error when a service registration includes a health check with a status that is set to unknown

Ex:

reg := &api.AgentServiceRegistration{
    Name:    "service-name",
    Port:    9999,
    Address: "127.0.0.1",
    Check: &api.AgentServiceCheck{
        TTL:    "60s",
        Status: "unknown",
    },
}

Returns this error (link to code):

"Status for checks must 'passing', 'warning', 'critical', 'unknown'"

That is because structs.ValidStatus(s string) does not consider "unknown" to be a valid status.

Is the intended behavior to allow unknown or does the error message need to be corrected to exclude it?

Would be happy to make a pull request to implement the change if this is indeed invalid behavior.

@slackpad slackpad added type/enhancement Proposed improvement or new feature easy labels Mar 10, 2016
@slackpad
Copy link
Contributor

Hi @shilov it looks like the "unknown" state is an old thing that was deprecated back in the 0.4.x series. We should probably just remove all references to it - it looks like it's only used in a dns_test.go unit test, and there's a reference in api/health.go. I'd be happy to take a PR if you are interested!

slackpad added a commit that referenced this issue Aug 18, 2016
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
Development

No branches or pull requests

2 participants