scope

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AWSClients

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

AWSClients contains all the aws clients used by the scopes.

type ClusterScope

type ClusterScope struct {
	logr.Logger

	AWSClients
	Cluster    *clusterv1.Cluster
	AWSCluster *infrav1.AWSCluster
	// contains filtered or unexported fields
}

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

func NewClusterScope

func NewClusterScope(params ClusterScopeParams) (*ClusterScope, error)

NewClusterScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

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

func (*ClusterScope) ControlPlaneConfigMapName

func (s *ClusterScope) ControlPlaneConfigMapName() string

ControlPlaneConfigMapName returns the name of the ConfigMap used to coordinate the bootstrapping of control plane nodes.

func (*ClusterScope) ListOptionsLabelSelector

func (s *ClusterScope) ListOptionsLabelSelector() client.ListOption

ListOptionsLabelSelector returns a ListOptions with a label selector for clusterName.

func (*ClusterScope) Name

func (s *ClusterScope) Name() string

Name returns the cluster name.

func (*ClusterScope) Namespace

func (s *ClusterScope) Namespace() string

Namespace returns the cluster namespace.

func (*ClusterScope) Network

func (s *ClusterScope) Network() *infrav1.Network

Network returns the cluster network object.

func (*ClusterScope) Region

func (s *ClusterScope) Region() string

Region returns the cluster region.

func (*ClusterScope) SecurityGroups

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

func (*ClusterScope) Subnets

func (s *ClusterScope) Subnets() infrav1.Subnets

Subnets returns the cluster subnets.

func (*ClusterScope) VPC

func (s *ClusterScope) VPC() *infrav1.VPCSpec

VPC returns the cluster VPC.

type ClusterScopeGetter

type ClusterScopeGetter interface {
	ClusterScope(params ClusterScopeParams) (*ClusterScope, error)
}

type ClusterScopeGetterFunc

type ClusterScopeGetterFunc func(params ClusterScopeParams) (*ClusterScope, error)

func (ClusterScopeGetterFunc) ClusterScope

func (f ClusterScopeGetterFunc) ClusterScope(params ClusterScopeParams) (*ClusterScope, error)

type ClusterScopeParams

type ClusterScopeParams struct {
	AWSClients
	Client     client.Client
	Logger     logr.Logger
	Cluster    *clusterv1.Cluster
	AWSCluster *infrav1.AWSCluster
}

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

type MachineScope

type MachineScope struct {
	logr.Logger

	Cluster    *clusterv1.Cluster
	Machine    *clusterv1.Machine
	AWSMachine *infrav1.AWSMachine
	// contains filtered or unexported fields
}

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 reconcile iteration.

func (*MachineScope) Close

func (m *MachineScope) Close() error

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

func (*MachineScope) GetInstanceID

func (m *MachineScope) GetInstanceID() *string

GetInstanceID returns the AWSMachine instance id by parsing Spec.ProviderID.

func (*MachineScope) GetInstanceState

func (m *MachineScope) GetInstanceState() *infrav1.InstanceState

GetInstanceID returns the AWSMachine instance state from the status.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the AWSMachine providerID from the spec.

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the AWSMachine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the namespace name.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

func (*MachineScope) SetAnnotation

func (m *MachineScope) SetAnnotation(key, value string)

SetAnnotation sets a key value annotation on the AWSMachine.

func (*MachineScope) SetErrorMessage

func (m *MachineScope) SetErrorMessage(v error)

SetErrorMessage sets the AWSMachine status error message.

func (*MachineScope) SetErrorReason

func (m *MachineScope) SetErrorReason(v capierrors.MachineStatusError)

SetErrorReason sets the AWSMachine status error reason.

func (*MachineScope) SetInstanceState

func (m *MachineScope) SetInstanceState(v infrav1.InstanceState)

SetInstanceID sets the AWSMachine instance id.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(v string)

SetProviderID sets the AWSMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the AWSMachine Ready Status

type MachineScopeGetter

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

type MachineScopeGetterFunc

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

func (MachineScopeGetterFunc) MachineScope

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

type MachineScopeParams

type MachineScopeParams struct {
	AWSClients
	Client  client.Client
	Logger  logr.Logger
	Cluster *clusterv1.Cluster
	//AWSCluster *infrav1.AWSCluster
	Machine    *clusterv1.Machine
	AWSMachine *infrav1.AWSMachine
}

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

Jump to

Keyboard shortcuts

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