Documentation ¶
Index ¶
- Variables
- func NewAllocRunner(config *config.AllocRunnerConfig) (interfaces.AllocRunner, error)
- func TestAllocRunnerFromAlloc(t *testing.T, alloc *structs.Allocation) (*allocRunner, func())
- func WaitForClientState(t *testing.T, ar interfaces.AllocRunner, state string)
- type FailHook
- func (h *FailHook) Destroy() error
- func (h *FailHook) LoadConfig(path string) *FailHook
- func (h *FailHook) Name() string
- func (h *FailHook) Postrun() error
- func (h *FailHook) PreKill()
- func (h *FailHook) PreTaskRestart() error
- func (h *FailHook) Prerun() error
- func (h *FailHook) Shutdown()
- func (h *FailHook) Update(request *interfaces.RunnerUpdateRequest) error
- type IPTables
- type MockStateUpdater
- type NetworkConfigurator
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 (*FailHook) LoadConfig ¶ added in v1.3.15
func (*FailHook) PreTaskRestart ¶ added in v1.3.15
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
type NetworkConfigurator interface { Setup(context.Context, *structs.Allocation, *drivers.NetworkIsolationSpec) (*structs.AllocNetworkStatus, error) Teardown(context.Context, *structs.Allocation, *drivers.NetworkIsolationSpec) error }
NetworkConfigurator sets up and tears down the interfaces, routes, firewall rules, etc for the configured networking mode of the allocation.
Source Files ¶
- alloc_runner.go
- alloc_runner_hooks.go
- allocdir_hook.go
- cgroup_hook.go
- consul_grpc_sock_hook.go
- consul_http_sock_hook.go
- csi_hook.go
- fail_hook.go
- groupservice_hook.go
- health_hook.go
- migrate_hook.go
- network_hook.go
- network_manager_linux.go
- networking.go
- networking_bridge_linux.go
- networking_cni.go
- testing.go
- upstream_allocs_hook.go
- util.go
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. |
Click to show internal directories.
Click to hide internal directories.