machine

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 15 Imported by: 2

Documentation

Index

Constants

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

	ConditionTypeDone = "EnsureDone"
)

Variables

This section is empty.

Functions

func Providers

func Providers() []string

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

func Register

func 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.

Types

type DelegateProvider added in v1.3.1

type DelegateProvider struct {
	ProviderName string

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

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

func (*DelegateProvider) AfterCreate added in v1.3.1

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

func (*DelegateProvider) Name added in v1.3.1

func (p *DelegateProvider) Name() string

func (*DelegateProvider) OnCreate added in v1.3.1

func (p *DelegateProvider) OnCreate(ctx context.Context, machine *platformv1.Machine, cluster *typesv1.Cluster) error

func (*DelegateProvider) OnDelete added in v1.3.1

func (p *DelegateProvider) OnDelete(ctx context.Context, machine *platformv1.Machine, cluster *typesv1.Cluster) error

func (*DelegateProvider) OnUpdate added in v1.3.1

func (p *DelegateProvider) OnUpdate(ctx context.Context, machine *platformv1.Machine, cluster *typesv1.Cluster) error

func (*DelegateProvider) PreCreate added in v1.3.1

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

func (*DelegateProvider) Validate added in v1.3.1

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

type Handler added in v1.3.1

func (Handler) Name added in v1.3.1

func (h Handler) Name() string

type Provider

type Provider interface {
	Name() string

	Validate(machine *platform.Machine) field.ErrorList

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

	OnCreate(ctx context.Context, machine *platformv1.Machine, cluster *typesv1.Cluster) error
	OnUpdate(ctx context.Context, machine *platformv1.Machine, cluster *typesv1.Cluster) error
	OnDelete(ctx context.Context, machine *platformv1.Machine, cluster *typesv1.Cluster) error
}

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

func GetProvider

func GetProvider(name string) (Provider, error)

GetProvider returns provider by name

Jump to

Keyboard shortcuts

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