allocrunner

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MPL-2.0 Imports: 58 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailHookError = errors.New("failed successfully")

Functions

func NewAllocRunner

func NewAllocRunner(config *config.AllocRunnerConfig) (interfaces.AllocRunner, error)

NewAllocRunner returns a new allocation runner.

func TestAllocRunnerFromAlloc

func TestAllocRunnerFromAlloc(t *testing.T, alloc *structs.Allocation) (*allocRunner, func())

func WaitForClientState added in v1.3.4

func WaitForClientState(t *testing.T, ar interfaces.AllocRunner, state string)

Types

type FailHook added in v1.3.15

type FailHook struct {
	Fail struct {
		Prerun         bool `hcl:"prerun,optional"`
		PreKill        bool `hcl:"prekill,optional"`
		Postrun        bool `hcl:"postrun,optional"`
		Destroy        bool `hcl:"destroy,optional"`
		Update         bool `hcl:"update,optional"`
		PreTaskRestart bool `hcl:"pretaskrestart,optional"`
		Shutdown       bool `hcl:"shutdown,optional"`
	}
	// contains filtered or unexported fields
}

func NewFailHook added in v1.3.15

func NewFailHook(l hclog.Logger, name string) *FailHook

func (*FailHook) Destroy added in v1.3.15

func (h *FailHook) Destroy() error

func (*FailHook) LoadConfig added in v1.3.15

func (h *FailHook) LoadConfig(path string) *FailHook

func (*FailHook) Name added in v1.3.15

func (h *FailHook) Name() string

func (*FailHook) Postrun added in v1.3.15

func (h *FailHook) Postrun() error

func (*FailHook) PreKill added in v1.3.15

func (h *FailHook) PreKill()

func (*FailHook) PreTaskRestart added in v1.3.15

func (h *FailHook) PreTaskRestart() error

func (*FailHook) Prerun added in v1.3.15

func (h *FailHook) Prerun() error

func (*FailHook) Shutdown added in v1.3.15

func (h *FailHook) Shutdown()

func (*FailHook) Update added in v1.3.15

func (h *FailHook) Update(request *interfaces.RunnerUpdateRequest) error

type IPTables added in v1.3.10

type IPTables interface {
	List(table, chain string) ([]string, error)
	Delete(table, chain string, rule ...string) error
	ClearAndDeleteChain(table, chain string) error
}

IPTables is a subset of iptables.IPTables

type MockStateUpdater

type MockStateUpdater struct {
	Updates []*structs.Allocation
	// contains filtered or unexported fields
}

MockStateUpdater implements the AllocStateHandler interface and records alloc updates.

func (*MockStateUpdater) AllocStateUpdated

func (m *MockStateUpdater) AllocStateUpdated(alloc *structs.Allocation)

AllocStateUpdated implements the AllocStateHandler interface and records an alloc update.

func (*MockStateUpdater) Last

func (m *MockStateUpdater) Last() *structs.Allocation

Last returns a copy of the last alloc (or nil) update. Safe for concurrent access with updates.

func (*MockStateUpdater) PutAllocation added in v1.3.0

func (m *MockStateUpdater) PutAllocation(alloc *structs.Allocation) (err error)

PutAllocation satisfies the AllocStateHandler interface.

func (*MockStateUpdater) Reset

func (m *MockStateUpdater) Reset()

Reset resets the recorded alloc updates.

type NetworkConfigurator added in v0.10.0

NetworkConfigurator sets up and tears down the interfaces, routes, firewall rules, etc for the configured networking mode of the allocation.

Directories

Path Synopsis
Package tasklifecycle manages the execution order of tasks based on their lifecycle configuration.
Package tasklifecycle manages the execution order of tasks based on their lifecycle configuration.

Jump to

Keyboard shortcuts

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