scope

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AzureClients

type AzureClients struct {
	SubscriptionID string
	Authorizer     autorest.Authorizer
}

AzureClients contains all the Azure clients used by the scopes.

type ClusterScope

type ClusterScope struct {
	logr.Logger

	AzureClients
	Cluster      *clusterv1.Cluster
	AzureCluster *infrav1.AzureCluster
	Context      context.Context
	// 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) APIServerPort

func (s *ClusterScope) APIServerPort() int32

APIServerPort returns the APIServerPort to use when creating the load balancer.

func (*ClusterScope) AdditionalTags

func (s *ClusterScope) AdditionalTags() infrav1.Tags

AdditionalTags returns AdditionalTags from the scope's AzureCluster.

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

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

func (*ClusterScope) ControlPlaneSubnet

func (s *ClusterScope) ControlPlaneSubnet() *infrav1.SubnetSpec

ControlPlaneSubnet returns the cluster control plane subnet.

func (*ClusterScope) ListOptionsLabelSelector

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

ListOptionsLabelSelector returns a ListOptions with a label selector for clusterName.

func (*ClusterScope) Location

func (s *ClusterScope) Location() string

Location returns the cluster location.

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) NodeSubnet

func (s *ClusterScope) NodeSubnet() *infrav1.SubnetSpec

NodeSubnet returns the cluster node subnet.

func (*ClusterScope) PatchObject added in v0.4.0

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) ResourceGroup

func (s *ClusterScope) ResourceGroup() string

ResourceGroup returns the cluster resource group.

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) Vnet

func (s *ClusterScope) Vnet() *infrav1.VnetSpec

Vnet returns the cluster Vnet.

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 {
	AzureClients
	Client       client.Client
	Logger       logr.Logger
	Cluster      *clusterv1.Cluster
	AzureCluster *infrav1.AzureCluster
	Context      context.Context
}

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

type MachineScope

type MachineScope struct {
	logr.Logger

	Cluster      *clusterv1.Cluster
	Machine      *clusterv1.Machine
	AzureCluster *infrav1.AzureCluster
	AzureMachine *infrav1.AzureMachine
	// 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) AdditionalTags

func (m *MachineScope) AdditionalTags() infrav1.Tags

AdditionalTags merges AdditionalTags from the scope's AzureCluster and AzureMachine. If the same key is present in both, the value from AzureMachine takes precedence.

func (*MachineScope) AvailabilityZone

func (m *MachineScope) AvailabilityZone() string

AvailabilityZone returns the AzureMachine Availability Zone.

func (*MachineScope) Close

func (m *MachineScope) Close() error

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

func (*MachineScope) GetBootstrapData added in v0.4.0

func (m *MachineScope) GetBootstrapData() (string, error)

GetBootstrapData returns the bootstrap data from the secret in the Machine's bootstrap.dataSecretName.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the AzureMachine providerID from the spec.

func (*MachineScope) GetVMID

func (m *MachineScope) GetVMID() *string

GetVMID returns the AzureMachine instance id by parsing Spec.ProviderID.

func (*MachineScope) GetVMState

func (m *MachineScope) GetVMState() *infrav1.VMState

GetVMState returns the AzureMachine VM state.

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) Location

func (m *MachineScope) Location() string

Location returns the AzureMachine location.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the AzureMachine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the namespace name.

func (*MachineScope) PatchObject added in v0.4.0

func (m *MachineScope) PatchObject() error

PatchObject persists the machine spec and status.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

func (*MachineScope) SetAddresses

func (m *MachineScope) SetAddresses(addrs []corev1.NodeAddress)

SetAddresses sets the Azure address status.

func (*MachineScope) SetAnnotation

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

SetAnnotation sets a key value annotation on the AzureMachine.

func (*MachineScope) SetFailureMessage added in v0.4.0

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the AzureMachine status failure message.

func (*MachineScope) SetFailureReason added in v0.4.0

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

SetFailureReason sets the AzureMachine status failure reason.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(v string)

SetProviderID sets the AzureMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the AzureMachine Ready Status

func (*MachineScope) SetVMState

func (m *MachineScope) SetVMState(v infrav1.VMState)

SetVMState sets the AzureMachine VM state.

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 {
	AzureClients
	Client       client.Client
	Logger       logr.Logger
	Cluster      *clusterv1.Cluster
	Machine      *clusterv1.Machine
	AzureCluster *infrav1.AzureCluster
	AzureMachine *infrav1.AzureMachine
}

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