machine

package
v0.0.0-...-86ffc8e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actuator

type Actuator interface {
	// Create the machine.
	Create(*clusterv1.Cluster, *clusterv1.Machine) error
	// Delete the machine.
	Delete(*clusterv1.Cluster, *clusterv1.Machine) error
	// Update the machine to the provided definition.
	Update(*clusterv1.Cluster, *clusterv1.Machine) error
	// Checks if the machine currently exists.
	Exists(*clusterv1.Cluster, *clusterv1.Machine) (bool, error)
}

Actuator controls machines on a specific infrastructure. All methods should be idempotent unless otherwise specified.

type MachineController

type MachineController struct {
	Name string

	BeforeReconcile func(key string)
	AfterReconcile  func(key string, err error)

	Informers *sharedinformers.SharedInformers
	// contains filtered or unexported fields
}

MachineController implements the controller.MachineController interface

func NewMachineController

func NewMachineController(config *rest.Config, si *sharedinformers.SharedInformers, actuator Actuator) *MachineController

NewController returns a new MachineController for responding to Machine events

func (*MachineController) GetName

func (c *MachineController) GetName() string

func (*MachineController) LookupAndReconcile

func (c *MachineController) LookupAndReconcile(key string) (err error)

func (*MachineController) Run

func (c *MachineController) Run(stopCh <-chan struct{})

func (*MachineController) RunAsync

func (c *MachineController) RunAsync(stopCh <-chan struct{})

func (*MachineController) StartWorkerQueue

func (c *MachineController) StartWorkerQueue(q *controller.QueueWorker, shutdown <-chan struct{})

StartWorkerQueue schedules a routine to continuously process Queue messages until shutdown is closed

type MachineControllerImpl

type MachineControllerImpl struct {
	builders.DefaultControllerFns
	// contains filtered or unexported fields
}

+controller:group=cluster,version=v1alpha1,kind=Machine,resource=machines

func (*MachineControllerImpl) Get

func (c *MachineControllerImpl) Get(namespace, name string) (*clusterv1.Machine, error)

func (*MachineControllerImpl) Init

Init initializes the controller and is called by the generated code Register watches for additional resource types here.

func (*MachineControllerImpl) Reconcile

func (c *MachineControllerImpl) Reconcile(machine *clusterv1.Machine) error

Reconcile handles enqueued messages. The delete will be handled by finalizer.

type TestActuator

type TestActuator struct {
	BlockOnCreate   bool
	BlockOnDelete   bool
	BlockOnUpdate   bool
	BlockOnExists   bool
	CreateCallCount int64
	DeleteCallCount int64
	UpdateCallCount int64
	ExistsCallCount int64
	ExistsValue     bool
	Lock            sync.Mutex
	// contains filtered or unexported fields
}

func NewTestActuator

func NewTestActuator() *TestActuator

func (*TestActuator) Create

func (*TestActuator) Delete

func (*TestActuator) Exists

func (*TestActuator) Unblock

func (a *TestActuator) Unblock()

func (*TestActuator) Update

func (a *TestActuator) Update(c *v1alpha1.Cluster, machine *v1alpha1.Machine) error

Jump to

Keyboard shortcuts

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