machine

package
v0.2.1-0...-227a541 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeNameEnvVar = "NODE_NAME"

	// ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set
	ExcludeNodeDrainingAnnotation = "machine.openshift.io/exclude-node-draining"

	// MachineRegionLabelName as annotation name for a machine region
	MachineRegionLabelName = "machine.openshift.io/region"

	// MachineAZLabelName as annotation name for a machine AZ
	MachineAZLabelName = "machine.openshift.io/zone"

	// MachineInstanceStateAnnotationName as annotation name for a machine instance state
	MachineInstanceStateAnnotationName = "machine.openshift.io/instance-state"

	// MachineInstanceTypeLabelName as annotation name for a machine instance type
	MachineInstanceTypeLabelName = "machine.openshift.io/instance-type"

	// MachineInterruptibleInstanceLabelName as annotaiton name for interruptible instances
	MachineInterruptibleInstanceLabelName = "machine.openshift.io/interruptible-instance"
)
View Source
const (
	PausedCondition machinev1.ConditionType = "Paused"

	PausedConditionReason = "AuthoritativeAPINotMachineAPI"

	NotPausedConditionReason = "AuthoritativeAPIMachineAPI"
)

We export the PausedCondition and reasons as they're shared across the Machine and MachineSet controllers.

Variables

This section is empty.

Functions

func AddWithActuator

func AddWithActuator(mgr manager.Manager, actuator Actuator, gate featuregate.MutableFeatureGate) error

func AddWithActuatorOpts

func AddWithActuatorOpts(mgr manager.Manager, actuator Actuator, opts controller.Options, gate featuregate.MutableFeatureGate) error

Types

type Actuator

type Actuator interface {
	// Create the machine.
	Create(context.Context, *machinev1.Machine) error
	// Delete the machine. If no error is returned, it is assumed that all dependent resources have been cleaned up.
	Delete(context.Context, *machinev1.Machine) error
	// Update the machine to the provided definition.
	Update(context.Context, *machinev1.Machine) error
	// Checks if the machine currently exists.
	Exists(context.Context, *machinev1.Machine) (bool, error)
}

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

var DefaultActuator Actuator

type MachineError

type MachineError struct {
	Reason  machinev1.MachineStatusError
	Message string
}

A more descriptive kind of error that represents an error condition that should be set in the Machine.Status. The "Reason" field is meant for short, enum-style constants meant to be interpreted by machines. The "Message" field is meant to be read by humans.

func CreateMachine

func CreateMachine(msg string, args ...interface{}) *MachineError

func DeleteMachine

func DeleteMachine(msg string, args ...interface{}) *MachineError

func InvalidMachineConfiguration

func InvalidMachineConfiguration(msg string, args ...interface{}) *MachineError

func UpdateMachine

func UpdateMachine(msg string, args ...interface{}) *MachineError

func (*MachineError) Error

func (e *MachineError) Error() string

type ReconcileMachine

type ReconcileMachine struct {
	client.Client
	// contains filtered or unexported fields
}

ReconcileMachine reconciles a Machine object

func (*ReconcileMachine) Reconcile

func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a Machine object and makes changes based on the state read and what is in the Machine.Spec +kubebuilder:rbac:groups=machine.openshift.io,resources=machines;machines/status,verbs=get;list;watch;create;update;patch;delete

type RequeueAfterError

type RequeueAfterError struct {
	RequeueAfter time.Duration
}

RequeueAfterError represents that an actuator managed object should be requeued for further processing after the given RequeueAfter time has passed.

func (*RequeueAfterError) Error

func (e *RequeueAfterError) Error() string

Error implements the error interface

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 (*TestActuator) Create

func (*TestActuator) Delete

func (*TestActuator) Exists

func (*TestActuator) Unblock

func (a *TestActuator) Unblock()

func (*TestActuator) Update

func (a *TestActuator) Update(ctx context.Context, machine *machinev1.Machine) error

Jump to

Keyboard shortcuts

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