Documentation ¶
Index ¶
Constants ¶
View Source
const (
// AllocHealthEventSource is the source used for emitting task events
AllocHealthEventSource = "Alloc Unhealthy"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks the health of an allocation and makes health events watchable via channels.
func NewTracker ¶
func NewTracker( parentCtx context.Context, logger hclog.Logger, alloc *structs.Allocation, allocUpdates *cstructs.AllocListener, taskEnvBuilder *taskenv.Builder, consulClient serviceregistration.Handler, checkStore checkstore.Shim, minHealthyTime time.Duration, useChecks bool, ) *Tracker
NewTracker returns a health tracker for the given allocation.
Depending on job configuration, an allocation's health takes into consideration - An alloc listener - Consul checks (via consul API) - Nomad checks (via client state)
func (*Tracker) AllocStoppedCh ¶
func (t *Tracker) AllocStoppedCh() <-chan struct{}
AllocStoppedCh returns a channel that will be fired if the allocation is stopped. This means that health will not be set.
Click to show internal directories.
Click to hide internal directories.