-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consul: support canary tags for services
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.
- Loading branch information
1 parent
1154ccc
commit 17c6eb8
Showing
9 changed files
with
477 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
package client | ||
|
||
import ( | ||
"github.com/hashicorp/nomad/client/driver" | ||
cstructs "github.com/hashicorp/nomad/client/structs" | ||
"github.com/hashicorp/nomad/command/agent/consul" | ||
"github.com/hashicorp/nomad/nomad/structs" | ||
) | ||
|
||
// ConsulServiceAPI is the interface the Nomad Client uses to register and | ||
// remove services and checks from Consul. | ||
type ConsulServiceAPI interface { | ||
RegisterTask(allocID string, task *structs.Task, restarter consul.TaskRestarter, exec driver.ScriptExecutor, net *cstructs.DriverNetwork) error | ||
RemoveTask(allocID string, task *structs.Task) | ||
UpdateTask(allocID string, existing, newTask *structs.Task, restart consul.TaskRestarter, exec driver.ScriptExecutor, net *cstructs.DriverNetwork) error | ||
RegisterTask(*consul.TaskServices) error | ||
RemoveTask(*consul.TaskServices) | ||
UpdateTask(old, newTask *consul.TaskServices) error | ||
AllocRegistrations(allocID string) (*consul.AllocRegistration, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.