open-nomad/client/consul/consul.go
Nick Ethier bd454a4c6f
client: improve group service stanza interpolation and check_re… (#6586)
* client: improve group service stanza interpolation and check_restart support

Interpolation can now be done on group service stanzas. Note that some task runtime specific information
that was previously available when the service was registered poststart of a task is no longer available.

The check_restart stanza for checks defined on group services will now properly restart the allocation upon
check failures if configured.
2019-11-18 13:04:01 -05:00

16 lines
501 B
Go

package consul
import (
"github.com/hashicorp/nomad/command/agent/consul"
)
// ConsulServiceAPI is the interface the Nomad Client uses to register and
// remove services and checks from Consul.
type ConsulServiceAPI interface {
RegisterWorkload(*consul.WorkloadServices) error
RemoveWorkload(*consul.WorkloadServices)
UpdateWorkload(old, newTask *consul.WorkloadServices) error
AllocRegistrations(allocID string) (*consul.AllocRegistration, error)
UpdateTTL(id, output, status string) error
}