b9bfb84b53
Ideally DriverNetwork would be fully populated in Driver.Prestart, but Docker doesn't assign the container's IP until you start the container. However, it's important to setup the port env vars before calling Driver.Start, so Prestart should populate that.
16 lines
580 B
Go
16 lines
580 B
Go
package client
|
|
|
|
import (
|
|
"github.com/hashicorp/nomad/client/driver"
|
|
cstructs "github.com/hashicorp/nomad/client/structs"
|
|
"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, exec driver.ScriptExecutor, net *cstructs.DriverNetwork) error
|
|
RemoveTask(allocID string, task *structs.Task)
|
|
UpdateTask(allocID string, existing, newTask *structs.Task, exec driver.ScriptExecutor) error
|
|
}
|