-
Notifications
You must be signed in to change notification settings - Fork 33
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
Blacklisted Healthcheck types #120
Conversation
} | ||
|
||
func (c *Consul) getIgnoredHealthCheckTypes() []string { | ||
ignoredTypes := make([]string, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like this:
ignoredTypes := strings.Split(strings.ToUpper(c.config.IgnoredHealthChecks), ","))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I've fixed it so ToUpper
is called once, but still I'd like to check if the input is valid (trim, remove empty values):
ignoredTypes := make([]string, 0)
for _, ignoredType := range strings.Split(strings.ToUpper(c.config.IgnoredHealthChecks), ",") {
var ignoredType = strings.TrimSpace(ignoredType)
if ignoredType != "" {
ignoredTypes = append(ignoredTypes, ignoredType)
}
}
return ignoredTypes
By default it returns empty splice.
👍 |
a1b6468
to
05376d4
Compare
05376d4
to
0285ada
Compare
LGTM 👍 |
Introducing
consul-ignored-healthchecks
configuration property which allows one to ignore specified types of Marathon health checks during service registration in Consul.Fixes #118