scope

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DnsSuffixLength = 6
)

Variables

This section is empty.

Functions

func NewMaasClient

func NewMaasClient(_ *ClusterScope) maasclient.ClientSetInterface

NewMaasClient creates a new MaaS client for a given session TODO (looking up on Env really the besT? though it is kind of what EC2 does

Types

type ClusterScope

type ClusterScope struct {
	logr.Logger

	Cluster     *clusterv1.Cluster
	MaasCluster *infrav1beta1.MaasCluster
	// 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() int

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

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

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

func (*ClusterScope) GetClusterMaasMachines

func (s *ClusterScope) GetClusterMaasMachines() ([]*infrav1beta1.MaasMachine, error)

GetActiveMaasMachines all MaaS machines NOT being deleted

func (*ClusterScope) GetDNSName

func (s *ClusterScope) GetDNSName() string

GetDNSName sets the Network systemID in spec. This can't do a lookup on Status.Network.DNSDomain name since it's derviced from here

func (*ClusterScope) IsAPIServerOnline

func (s *ClusterScope) IsAPIServerOnline() (bool, error)

func (*ClusterScope) PatchObject

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) ReconcileMaasClusterWhenAPIServerIsOnline

func (s *ClusterScope) ReconcileMaasClusterWhenAPIServerIsOnline()

func (*ClusterScope) SetDNSName

func (s *ClusterScope) SetDNSName(dnsName string)

SetDNSName sets the Network systemID in spec.

type ClusterScopeParams

type ClusterScopeParams struct {
	Client              client.Client
	Logger              logr.Logger
	Cluster             *clusterv1.Cluster
	MaasCluster         *infrav1beta1.MaasCluster
	ControllerName      string
	Tracker             *remote.ClusterCacheTracker
	ClusterEventChannel chan event.GenericEvent
}

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

type MachineScope

type MachineScope struct {
	logr.Logger

	Cluster      *clusterv1.Cluster
	ClusterScope *ClusterScope

	Machine     *clusterv1.Machine
	MaasMachine *infrav1beta1.MaasMachine
	// contains filtered or unexported fields
}

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

func NewMachineScope

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

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

func (*MachineScope) Close

func (m *MachineScope) Close() error

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

func (*MachineScope) GetInstanceID

func (m *MachineScope) GetInstanceID() *string

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

func (*MachineScope) GetMachineHostname

func (m *MachineScope) GetMachineHostname() string

GetMachineHostname retrns the hostname

func (*MachineScope) GetMachineState

func (m *MachineScope) GetMachineState() *infrav1beta1.MachineState

GetMachineState returns the MaasMachine instance state from the status.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the MaasMachine providerID from the spec.

func (*MachineScope) GetRawBootstrapData

func (m *MachineScope) GetRawBootstrapData() ([]byte, error)

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

func (*MachineScope) GetSystemID added in v0.4.0

func (m *MachineScope) GetSystemID() string

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) IsReady

func (m *MachineScope) IsReady() bool

IsReady gets MaasMachine Ready Status

func (*MachineScope) MachineIsInKnownState

func (m *MachineScope) MachineIsInKnownState() bool

func (*MachineScope) MachineIsOperational

func (m *MachineScope) MachineIsOperational() bool

func (*MachineScope) MachineIsRunning

func (m *MachineScope) MachineIsRunning() bool

func (*MachineScope) PatchObject

func (m *MachineScope) PatchObject() error

PatchObject persists the machine configuration 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 []clusterv1.MachineAddress)

SetAddresses sets the MAAS Machine address status.

func (*MachineScope) SetFailureDomain

func (m *MachineScope) SetFailureDomain(availabilityZone string)

SetFailureDomain sets the MaasMachine systemID in spec.

func (*MachineScope) SetFailureMessage

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the MaasMachine status failure message.

func (*MachineScope) SetFailureReason

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

SetFailureReason sets the MaasMachine status failure reason.

func (*MachineScope) SetMachineHostname

func (m *MachineScope) SetMachineHostname(hostname string)

SetMachineHostname sets the hostname

func (*MachineScope) SetMachineState

func (m *MachineScope) SetMachineState(v infrav1beta1.MachineState)

SetMachineState sets the MaasMachine status instance state.

func (*MachineScope) SetNodeProviderID

func (m *MachineScope) SetNodeProviderID() error

SetNodeProviderID patches the node with the ID

func (*MachineScope) SetNotReady

func (m *MachineScope) SetNotReady()

SetNotReady sets the MaasMachine Ready Status to false

func (*MachineScope) SetPowered

func (m *MachineScope) SetPowered(powered bool)

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(systemID, availabilityZone string)

SetProviderID sets the MaasMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the MaasMachine Ready Status

func (*MachineScope) SetSystemID

func (m *MachineScope) SetSystemID(systemID string)

SetInstanceID sets the MaasMachine systemID in spec.

type MachineScopeParams

type MachineScopeParams struct {
	Client         client.Client
	Logger         logr.Logger
	Cluster        *clusterv1.Cluster
	ClusterScope   *ClusterScope
	Machine        *clusterv1.Machine
	MaasMachine    *infrav1beta1.MaasMachine
	ControllerName string

	Tracker *remote.ClusterCacheTracker
}

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

Jump to

Keyboard shortcuts

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