scope

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterScope

type ClusterScope struct {
	logr.Logger

	Cluster       *clusterv1.Cluster
	PacketCluster *infrav1.PacketCluster
	// 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 ClusterScope from the supplied parameters. This is meant to be called for each reconcile iteration only on PacketClusterReconciler.

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

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

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

func (s *ClusterScope) SetReady()

SetReady sets the PacketCluster Ready Status

type ClusterScopeParams

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

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

type MachineScope

type MachineScope struct {
	logr.Logger

	Cluster       *clusterv1.Cluster
	Machine       *clusterv1.Machine
	PacketCluster *infrav1.PacketCluster
	PacketMachine *infrav1.PacketMachine
	// 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 both PacketClusterReconciler and PacketMachineReconciler.

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 DOMachine droplet instance id by parsing Spec.ProviderID.

func (*MachineScope) GetInstanceStatus

func (m *MachineScope) GetInstanceStatus() *infrav1.PacketResourceStatus

GetInstanceStatus returns the PacketMachine device instance status from the status.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the DOMachine 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) 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 PacketMachine name

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the PacketMachine namespace

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 address status.

func (*MachineScope) SetErrorMessage

func (m *MachineScope) SetErrorMessage(v error)

SetErrorMessage sets the PacketMachine status error message.

func (*MachineScope) SetErrorReason

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

SetErrorReason sets the PacketMachine status error reason.

func (*MachineScope) SetInstanceStatus

func (m *MachineScope) SetInstanceStatus(v infrav1.PacketResourceStatus)

SetInstanceStatus sets the PacketMachine device id.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(deviceID string)

SetProviderID sets the DOMachine providerID in spec from device id.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the PacketMachine Ready Status

func (*MachineScope) Tags

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

AdditionalTags returns Tags from the scope's PacketMachine. The returned value will never be nil.

type MachineScopeParams

type MachineScopeParams struct {
	Client        client.Client
	Logger        logr.Logger
	Cluster       *clusterv1.Cluster
	Machine       *clusterv1.Machine
	PacketCluster *infrav1.PacketCluster
	PacketMachine *infrav1.PacketMachine
}

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