agent

package
v4.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AGENT_INIT = state(iota)
	AGENT_WAIT_FOR_RUNNABLE
	AGENT_RUN_TASK
	AGENT_WAIT_FOR_CHANGE_STAGE
	AGENT_CHANGE_STAGE
	AGENT_EXIT
	AGENT_REBOOT
	AGENT_POWEROFF
	AGENT_KEXEC
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

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 added in v4.2.0

func (a *Agent) Close()

func (*Agent) Context added in v4.0.21

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

func (*Agent) Kill added in v4.0.21

func (a *Agent) Kill() error

func (*Agent) Run

func (a *Agent) Run() error

Run kicks off the state machine for this agent.

func (*Agent) RunnerDir added in v4.0.21

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

func (*Agent) StateLoc

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

func (*Agent) Timeout

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL