machine

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// EcsImageStatusAvailable Image status
	EcsImageStatusAvailable = "Available"

	// MaxInstanceOfSecurityGroupTypeNoraml A basic security group can contain a maximum of 2,000 instances.
	MaxInstanceOfSecurityGroupTypeNoraml = 2000

	// MaxInstanceOfSecurityGroupTypeEnterprise An advanced security group can contain a maximum of 65,536 instances.
	MaxInstanceOfSecurityGroupTypeEnterprise = 65536

	// SecurityGroupTypeNoraml SecurityGroup type normal
	SecurityGroupTypeNoraml = "normal"
	// SecurityGroupTypeEnterprise SecurityGroup type enterprise
	SecurityGroupTypeEnterprise = "enterprise"

	// InstanceDefaultTimeout default timeout
	InstanceDefaultTimeout = 900
	// DefaultWaitForInterval default interval
	DefaultWaitForInterval = 5

	// ECSInstanceStatusPending ecs instance status Pedding
	ECSInstanceStatusPending = "Pending"
	// ECSInstanceStatusStarting ecs instance status Starting
	ECSInstanceStatusStarting = "Starting"
	// ECSInstanceStatusRunning ecs instance status Running
	ECSInstanceStatusRunning = "Running"
	// ECSInstanceStatusStopping ecs instance status Stopping
	ECSInstanceStatusStopping = "Stopping"
	// ECSInstanceStatusStopped ecs instance status Stopped
	ECSInstanceStatusStopped = "Stopped"

	// ECSTagResourceTypeInstance  tag resource type
	ECSTagResourceTypeInstance = "instance"
)

Variables

This section is empty.

Functions

func WaitForResult

func WaitForResult(name string, predicate func() (bool, interface{}, error), returnWhenError bool, delay int, timeout int) (interface{}, error)

WaitForResult wait func

Types

type Actuator

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

Actuator is responsible for performing machine reconciliation.

func NewActuator

func NewActuator(params ActuatorParams) *Actuator

NewActuator returns an actuator.

func (*Actuator) Create

func (a *Actuator) Create(ctx context.Context, machine *machinev1.Machine) error

Create creates a machine and is invoked by the machine controller.

func (*Actuator) Delete

func (a *Actuator) Delete(ctx context.Context, machine *machinev1.Machine) error

Delete deletes a machine and updates its finalizer

func (*Actuator) Exists

func (a *Actuator) Exists(ctx context.Context, machine *machinev1.Machine) (bool, error)

Exists determines if the given machine currently exists. A machine which is not terminated is considered as existing.

func (*Actuator) Update

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

Update attempts to sync machine state with an existing instance.

type ActuatorParams

type ActuatorParams struct {
	Client        controllerclient.Client
	EventRecorder record.EventRecorder

	AlibabaCloudClientBuilder alibabacloudClient.AlibabaCloudClientBuilderFunc
	ConfigManagedClient       controllerclient.Client

	ReconcilerBuilder func(scope *machineScope) *Reconciler
}

ActuatorParams holds parameter information for Actuator.

type Reconciler

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

Reconciler runs the logic to reconciles a machine resource towards its desired state

func NewReconciler

func NewReconciler(scope *machineScope) *Reconciler

NewReconciler creating new Reconciler instance

func (*Reconciler) Create

func (r *Reconciler) Create(ctx context.Context) error

Create creates machine if and only if machine exists, handled by cluster-api

func (*Reconciler) CreateMachine

func (r *Reconciler) CreateMachine(ctx context.Context) (*ecs.Instance, error)

func (*Reconciler) Delete

func (r *Reconciler) Delete(ctx context.Context) error

Delete deletes machine

func (*Reconciler) DeleteMachine

func (r *Reconciler) DeleteMachine(ctx context.Context) error

func (*Reconciler) Exists

func (r *Reconciler) Exists(ctx context.Context) (bool, error)

Exists checks if machine exists

func (*Reconciler) Update

func (r *Reconciler) Update(ctx context.Context) error

Update updates machine if and only if machine exists, handled by cluster-api

func (*Reconciler) UpdateMachine

func (r *Reconciler) UpdateMachine(ctx context.Context) (*ecs.Instance, error)

Jump to

Keyboard shortcuts

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