-
Notifications
You must be signed in to change notification settings - Fork 2k
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
allocrunner: fix health check monitoring for Consul services #16402
Conversation
3394881
to
0765b15
Compare
aef1b2d
to
ec39330
Compare
ec39330
to
f7fcf1b
Compare
Services must be interpolated to replace runtime variables before they can be compared against the values returned by Consul.
f7fcf1b
to
5f8dabf
Compare
After all my failed attempts to refactor the service interpolation so it's closer to the Then I realized that my initial implementation was quite wrong. As the name suggests, each
And since So |
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.
LGTM; just one suggestion you could ignore. my thinking is we want folks to complain about bugs if we are validating / canonicalizing things incorrectly. if we try to do the right thing they may just ignore what is otherwise a serious bug
client/allochealth/tracker.go
Outdated
if env == nil { | ||
// This is not expected to happen, but guard against a nil | ||
// task environment by using the group environment since it has | ||
// most of the same values. | ||
t.logger.Warn("task environment not found, using group level environment for variable interpolation", | ||
"alloc_id", t.alloc.ID, "task", service.TaskName) | ||
env = t.taskEnvs[""] |
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.
we [should] already guard against this in Validate/Canonicalize; instead of trying to make things maybe work in an unexpected situation I think we should just do nothing, e.g.
if env != nil {
// assign
} else {
logger.Error("you found a bug!")
}
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.
Hum...good point. Changed to this in 925d347
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.
👍
Services must be canonicalized and have its values interpolated before comparing with the values returned by Consul.
Close #16382
Close #16307