actuators

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultScopeGetter        ScopeGetter        = ScopeGetterFunc(NewScope)
	DefaultMachineScopeGetter MachineScopeGetter = MachineScopeGetterFunc(NewMachineScope)
)

Functions

func MachineConfigFromProviderSpec added in v0.1.1

func MachineConfigFromProviderSpec(clusterClient client.MachineClassesGetter, providerConfig clusterv1.ProviderSpec, log logr.Logger) (*v1alpha1.AWSMachineProviderSpec, error)

MachineConfigFromProviderSpec tries to decode the JSON-encoded spec, falling back on getting a MachineClass if the value is absent.

Types

type AWSClients

type AWSClients struct {
	EC2 ec2iface.EC2API
	ELB elbiface.ELBAPI
}

AWSClients contains all the aws clients used by the scopes.

type MachineScope

type MachineScope struct {
	*Scope

	Machine *clusterv1.Machine
	// MachineCopy is used to generate a patch diff at the end of the scope's lifecycle.
	MachineCopy   *clusterv1.Machine
	MachineClient client.MachineInterface
	MachineConfig *v1alpha1.AWSMachineProviderSpec
	MachineStatus *v1alpha1.AWSMachineProviderStatus
}

MachineScope defines a scope defined around a machine and its cluster.

func NewMachineScope

func NewMachineScope(params MachineScopeParams) (*MachineScope, error)

NewMachineScope creates a new MachineScope from the supplied parameters. This is meant to be called for each machine actuator operation.

func (*MachineScope) Close

func (m *MachineScope) Close()

Close the MachineScope by updating the machine spec, machine status.

func (*MachineScope) GetMachine added in v0.2.1

func (m *MachineScope) GetMachine() *clusterv1.Machine

GetMachine returns the machine wrapped in the scope.

func (*MachineScope) GetScope added in v0.2.1

func (m *MachineScope) GetScope() *Scope

GetScope returns the scope that is wrapping the machine.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the machine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the machine namespace.

func (*MachineScope) Region

func (m *MachineScope) Region() string

Region returns the machine region.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

type MachineScopeGetter

type MachineScopeGetter interface {
	GetMachineScope(params MachineScopeParams) (*MachineScope, error)
}

type MachineScopeGetterFunc

type MachineScopeGetterFunc func(params MachineScopeParams) (*MachineScope, error)

func (MachineScopeGetterFunc) GetMachineScope

func (f MachineScopeGetterFunc) GetMachineScope(params MachineScopeParams) (*MachineScope, error)

type MachineScopeParams

type MachineScopeParams struct {
	AWSClients
	Cluster *clusterv1.Cluster
	Machine *clusterv1.Machine
	Client  client.ClusterV1alpha1Interface
	Logger  logr.Logger
}

MachineScopeParams defines the input parameters used to create a new MachineScope.

type Scope

type Scope struct {
	AWSClients
	Cluster *clusterv1.Cluster
	// ClusterCopy is used for patch generation at the end of the scope's lifecycle.
	ClusterCopy   *clusterv1.Cluster
	ClusterClient client.ClusterInterface
	ClusterConfig *v1alpha1.AWSClusterProviderSpec
	ClusterStatus *v1alpha1.AWSClusterProviderStatus
	logr.Logger
}

Scope defines the basic context for an actuator to operate upon.

func NewScope

func NewScope(params ScopeParams) (*Scope, error)

NewScope creates a new Scope from the supplied parameters. This is meant to be called for each different actuator iteration.

func (*Scope) Close

func (s *Scope) Close()

Close closes the current scope persisting the cluster configuration and status.

func (*Scope) Name

func (s *Scope) Name() string

Name returns the cluster name.

func (*Scope) Namespace

func (s *Scope) Namespace() string

Namespace returns the cluster namespace.

func (*Scope) Network

func (s *Scope) Network() *v1alpha1.Network

Network returns the cluster network object.

func (*Scope) Region

func (s *Scope) Region() string

Region returns the cluster region.

func (*Scope) SecurityGroups

func (s *Scope) SecurityGroups() map[v1alpha1.SecurityGroupRole]*v1alpha1.SecurityGroup

SecurityGroups returns the cluster security groups as a map, it creates the map if empty.

func (*Scope) Subnets

func (s *Scope) Subnets() v1alpha1.Subnets

Subnets returns the cluster subnets.

func (*Scope) VPC

func (s *Scope) VPC() *v1alpha1.VPCSpec

VPC returns the cluster VPC.

type ScopeGetter

type ScopeGetter interface {
	GetScope(params ScopeParams) (*Scope, error)
}

type ScopeGetterFunc

type ScopeGetterFunc func(params ScopeParams) (*Scope, error)

func (ScopeGetterFunc) GetScope

func (f ScopeGetterFunc) GetScope(params ScopeParams) (*Scope, error)

type ScopeParams

type ScopeParams struct {
	AWSClients
	Cluster *clusterv1.Cluster
	Client  client.ClusterV1alpha1Interface
	Logger  logr.Logger
}

ScopeParams defines the input parameters used to create a new Scope.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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