provision: Index | Files

package agent

import ""


Package Files

agent.go chroot_linux.go cmdHelper.go mktd.go taskRunner.go


const (
    AGENT_INIT = state(iota)

type Agent Uses

type Agent struct {
    // contains filtered or unexported fields

Agent implements a new machine agent structured as a finite state machine. There is one important behavioural change to the behaviour of the runner that may impact how workflows are built:

The RunnerWait flag in stages is no longer honored. Instead, the agent will wait by default, unless overridden by the following conditions, in order of priority:

* The next stage has the Reboot flag set.

* The change-stage/map entry for the next stage has a Stop, Reboot,

or Poweroff clause.

* The machine is currently in a bootenv that ends in -install and

there is nothing else to do, in which case the runner will exit

Additionally, this agent will automatically reboot the system when it detects that the machine's boot environment has changed, unless the machine is in an OS install, in which case the agent will exit.

func New Uses

func New(c *api.Client, m *models.Machine,
    exitOnNotRunnable, exitOnFailure, actuallyPowerThings bool,
    logger io.Writer) (*Agent, error)

New creates a new FSM based Machine Agent that starts out in the AGENT_INIT state.

func (*Agent) Close Uses

func (a *Agent) Close()

func (*Agent) Context Uses

func (a *Agent) Context(s string) *Agent

func (*Agent) Kill Uses

func (a *Agent) Kill() error

func (*Agent) Run Uses

func (a *Agent) Run() error

Run kicks off the state machine for this agent.

func (*Agent) RunnerDir Uses

func (a *Agent) RunnerDir(s string) *Agent

func (*Agent) StateLoc Uses

func (a *Agent) StateLoc(s string) *Agent

func (*Agent) Timeout Uses

func (a *Agent) Timeout(t time.Duration) *Agent

Timeout allows you to change how long the Agent will wait for an event from dr-provision from the default of 1 hour.

Package agent imports 23 packages (graph). Updated 2020-07-09. Refresh now. Tools for package owners.