-
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
Support canary tags for services in Consul #4200
Conversation
e357d1e
to
6347cee
Compare
Also refactor Consul ServiceClient to take a struct instead of a massive set of arguments. Meant updating a lot of code but it should be far easier to extend in the future as you will only need to update a single struct instead of every single call site. Adds an e2e test for canary tags.
Guard against Canary being set to false at the same time as an allocation is being stopped: this could cause RemoveTask to be called with the wrong Canary value and leaking a service. Deleting both Canary values is the safest route.
6347cee
to
0b560b0
Compare
nomad/structs/structs.go
Outdated
@@ -3814,6 +3814,11 @@ func (s *Service) Hash(allocID, taskName string) string { | |||
io.WriteString(h, tag) | |||
} | |||
|
|||
// Vary ID on whether or not CanaryTags will be used | |||
if canary { | |||
h.Write([]byte{'1'}) |
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.
What do you think about writing "Canary"?
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Also refactor Consul ServiceClient to take a struct instead of a massive
set of arguments. Meant updating a lot of code but it should be far
easier to extend in the future as you will only need to update a single
struct instead of every single call site.
Adds an e2e test for canary tags.
Fixes #2920