provision

package
v0.0.0-...-3a937ec Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandInstruction

type CommandInstruction struct {
	// contains filtered or unexported fields
}

func NewCommandInstruction

func NewCommandInstruction(phase int, unitFile allocation.UnitFile, command string) *CommandInstruction

func (*CommandInstruction) Execute

func (i *CommandInstruction) Execute(conn *dbus.Conn) (err error)

func (CommandInstruction) Phase

func (i CommandInstruction) Phase() int

func (CommandInstruction) String

func (i CommandInstruction) String() string

type DeleteUnitInstruction

type DeleteUnitInstruction struct {
	// contains filtered or unexported fields
}

DeleteUnitInstruction disables and removes unit from systemd

func NewDeleteUnitInstruction

func NewDeleteUnitInstruction(unitFile allocation.UnitFile) *DeleteUnitInstruction

func (*DeleteUnitInstruction) Execute

func (i *DeleteUnitInstruction) Execute(conn *dbus.Conn) (err error)

func (DeleteUnitInstruction) Phase

func (i DeleteUnitInstruction) Phase() int

func (DeleteUnitInstruction) String

func (i DeleteUnitInstruction) String() string

type DestroyBlobInstruction

type DestroyBlobInstruction struct {
	// contains filtered or unexported fields
}

func NewDestroyBlobInstruction

func NewDestroyBlobInstruction(phase int, blob *allocation.Blob) (i *DestroyBlobInstruction)

func (*DestroyBlobInstruction) Execute

func (i *DestroyBlobInstruction) Execute(conn *dbus.Conn) (err error)

func (DestroyBlobInstruction) Phase

func (i DestroyBlobInstruction) Phase() int

func (DestroyBlobInstruction) String

func (i DestroyBlobInstruction) String() string

type DisableUnitInstruction

type DisableUnitInstruction struct {
	// contains filtered or unexported fields
}

func NewDisableUnitInstruction

func NewDisableUnitInstruction(unitFile allocation.UnitFile) *DisableUnitInstruction

func (*DisableUnitInstruction) Execute

func (i *DisableUnitInstruction) Execute(conn *dbus.Conn) (err error)

func (DisableUnitInstruction) Phase

func (i DisableUnitInstruction) Phase() int

func (DisableUnitInstruction) String

func (i DisableUnitInstruction) String() string

type EnableUnitInstruction

type EnableUnitInstruction struct {
	// contains filtered or unexported fields
}

func NewEnableUnitInstruction

func NewEnableUnitInstruction(unitFile allocation.UnitFile) *EnableUnitInstruction

func (*EnableUnitInstruction) Execute

func (i *EnableUnitInstruction) Execute(conn *dbus.Conn) (err error)

func (EnableUnitInstruction) Phase

func (i EnableUnitInstruction) Phase() int

func (EnableUnitInstruction) String

func (i EnableUnitInstruction) String() string

type Evaluation

type Evaluation struct {
	Left  *allocation.Pod
	Right *allocation.Pod
	// contains filtered or unexported fields
}

func NewEvaluation

func NewEvaluation(left, right *allocation.Pod) (e *Evaluation)

func (*Evaluation) Explain

func (e *Evaluation) Explain() string

func (*Evaluation) Name

func (e *Evaluation) Name() (res string)

func (*Evaluation) Plan

func (e *Evaluation) Plan() (res []Instruction)

func (*Evaluation) String

func (e *Evaluation) String() (res string)

type Evaluator

type Evaluator struct {
	*supervisor.Control
	// contains filtered or unexported fields
}

func NewEvaluator

func NewEvaluator(ctx context.Context, log *logx.Log, config EvaluatorConfig) (e *Evaluator)

func (*Evaluator) Allocate

func (e *Evaluator) Allocate(pod *manifest.Pod, env map[string]string)

func (*Evaluator) Deallocate

func (e *Evaluator) Deallocate(name string)

func (*Evaluator) GetConstraint

func (e *Evaluator) GetConstraint(pod *manifest.Pod) (res manifest.Constraint)

Returns all base constraints including resources

func (*Evaluator) Open

func (e *Evaluator) Open() (err error)

type EvaluatorConfig

type EvaluatorConfig struct {
	SystemPaths    allocation.SystemPaths
	Recovery       allocation.PodSlice // recovery state
	StatusConsumer bus.Consumer        // consumer for "evaluation.<pod>.*"
}

type EvaluatorState

type EvaluatorState struct {
	// contains filtered or unexported fields
}

func NewEvaluatorState

func NewEvaluatorState(log *logx.Log, recovered allocation.PodSlice) (s *EvaluatorState)

func (*EvaluatorState) Commit

func (s *EvaluatorState) Commit(name string) (next []*Evaluation)

Commit in progress evaluation

func (*EvaluatorState) Submit

func (s *EvaluatorState) Submit(name string, pod *allocation.Pod) (next []*Evaluation)

Submit allocation to state. Returns allocations ready to execute.

type Instruction

type Instruction interface {
	Phase() int
	Execute(conn *dbus.Conn) (err error)
	String() string
}

Instruction represents one atomic instruction bounded to specific phase

func PlanBlob

func PlanBlob(left, right *allocation.Blob) (res []Instruction)

type WriteBlobInstruction

type WriteBlobInstruction struct {
	// contains filtered or unexported fields
}

func NewWriteBlobInstruction

func NewWriteBlobInstruction(phase int, blob *allocation.Blob) (i *WriteBlobInstruction)

func (*WriteBlobInstruction) Execute

func (i *WriteBlobInstruction) Execute(conn *dbus.Conn) (err error)

func (WriteBlobInstruction) Phase

func (i WriteBlobInstruction) Phase() int

func (WriteBlobInstruction) String

func (i WriteBlobInstruction) String() string

type WriteUnitInstruction

type WriteUnitInstruction struct {
	// contains filtered or unexported fields
}

WriteUnitInstruction writes unitFile to filesystem and runs daemon reload.

func NewWriteUnitInstruction

func NewWriteUnitInstruction(unitFile allocation.UnitFile) *WriteUnitInstruction

func (*WriteUnitInstruction) Execute

func (i *WriteUnitInstruction) Execute(conn *dbus.Conn) (err error)

func (WriteUnitInstruction) Phase

func (i WriteUnitInstruction) Phase() int

func (WriteUnitInstruction) String

func (i WriteUnitInstruction) String() string

Jump to

Keyboard shortcuts

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