machine

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonWaiting      = "Waiting"
	ReasonSkip         = "Skip"
	ReasonFailedInit   = "FailedInit"
	ReasonFailedUpdate = "FailedUpdate"
	ReasonFailedDelete = "FailedDelete"

	ConditionTypeDone = "EnsureDone"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DelegateProvider

type DelegateProvider struct {
	ProviderName string

	ValidateFunc    func(machine *devopsv1.Machine) field.ErrorList
	PreCreateFunc   func(machine *devopsv1.Machine) error
	AfterCreateFunc func(machine *devopsv1.Machine) error

	CreateHandlers []Handler
	DeleteHandlers []Handler
	UpdateHandlers []Handler
}

func (*DelegateProvider) AfterCreate

func (p *DelegateProvider) AfterCreate(machine *devopsv1.Machine) error

func (*DelegateProvider) Name

func (p *DelegateProvider) Name() string

func (*DelegateProvider) OnCreate

func (p *DelegateProvider) OnCreate(ctx *common.ClusterContext, machine *devopsv1.Machine) error

func (*DelegateProvider) OnDelete

func (p *DelegateProvider) OnDelete(ctx *common.ClusterContext, machine *devopsv1.Machine) error

func (*DelegateProvider) OnUpdate

func (p *DelegateProvider) OnUpdate(ctx *common.ClusterContext, machine *devopsv1.Machine) error

func (*DelegateProvider) PreCreate

func (p *DelegateProvider) PreCreate(machine *devopsv1.Machine) error

func (*DelegateProvider) Validate

func (p *DelegateProvider) Validate(machine *devopsv1.Machine) field.ErrorList

type Handler

type Handler func(*common.ClusterContext, *devopsv1.Machine) error

func (Handler) Name

func (h Handler) Name() string

type MpManager

type MpManager struct {
	sync.RWMutex
	Mp map[string]Provider
}

func New

func New() *MpManager

func (*MpManager) GetProvider

func (p *MpManager) GetProvider(name string) (Provider, error)

GetProvider returns provider by name

func (*MpManager) Providers

func (p *MpManager) Providers() []string

Providers returns a sorted list of the names of the registered providers.

func (*MpManager) Register

func (p *MpManager) Register(name string, provider Provider)

Register makes a provider available by the provided name. If Register is called twice with the same name or if provider is nil, it panics.

type Provider

type Provider interface {
	Name() string

	Validate(machine *devopsv1.Machine) field.ErrorList

	PreCreate(machine *devopsv1.Machine) error
	AfterCreate(machine *devopsv1.Machine) error

	OnCreate(ctx *common.ClusterContext, machine *devopsv1.Machine) error
	OnUpdate(ctx *common.ClusterContext, machine *devopsv1.Machine) error
	OnDelete(ctx *common.ClusterContext, machine *devopsv1.Machine) error
}

Provider defines a set of response interfaces for specific machine types in machine management.

Jump to

Keyboard shortcuts

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