taskexecutor

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCPUUsage  float64 = 80
	MaxMemUsage  float64 = 80
	MaxDiskUsage float64 = 80
)
View Source
const (
	TaskPrePull = "prepull"
)
View Source
const (
	TaskUpgrade = "upgrade"
)

Variables

View Source
var (
	CommonMethods = map[string]func(types.NodeTaskRequest) fsm.Event{
		string(v1alpha1.TaskChecking): preCheck,
		string(v1alpha1.TaskInit):     normalInit,
	}
)

Functions

func Register

func Register(name string, executor Executor)

Types

type BaseExecutor

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

func NewBaseExecutor

func NewBaseExecutor(name string, methods map[string]func(types.NodeTaskRequest) fsm.Event) *BaseExecutor

func (*BaseExecutor) Do

func (be *BaseExecutor) Do(taskReq types.NodeTaskRequest) (fsm.Event, error)

func (*BaseExecutor) Name

func (be *BaseExecutor) Name() string

type Executor

type Executor interface {
	Name() string
	Do(types.NodeTaskRequest) (fsm.Event, error)
}

func GetExecutor

func GetExecutor(name string) (Executor, error)

func NewPrePullExecutor

func NewPrePullExecutor() Executor

func NewUpgradeExecutor

func NewUpgradeExecutor() Executor

type PrePull

type PrePull struct {
	*BaseExecutor
}

func (*PrePull) Name

func (p *PrePull) Name() string

type Upgrade

type Upgrade struct {
	*BaseExecutor
}

func (*Upgrade) Name

func (u *Upgrade) Name() string

Jump to

Keyboard shortcuts

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