scope

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package scope defines the capmox scopes used for reconciliation.

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
	ProxmoxCluster *infrav1alpha1.ProxmoxCluster

	ProxmoxClient proxmox.Client

	IPAMHelper *ipam.Helper
	// 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) ControlPlaneEndpoint

func (s *ClusterScope) ControlPlaneEndpoint() clusterv1.APIEndpoint

ControlPlaneEndpoint returns the ControlPlaneEndpoint for the associated ProxmoxCluster.

func (*ClusterScope) InfraClusterName

func (s *ClusterScope) InfraClusterName() string

InfraClusterName returns the name of the Proxmox cluster.

func (*ClusterScope) KubernetesClusterName

func (s *ClusterScope) KubernetesClusterName() string

KubernetesClusterName is the name of the Kubernetes cluster. For the cluster scope this is the same as the CAPI cluster name.

func (*ClusterScope) Name

func (s *ClusterScope) Name() string

Name returns the CAPI cluster name.

func (*ClusterScope) Namespace

func (s *ClusterScope) Namespace() string

Namespace returns the cluster namespace.

func (*ClusterScope) PatchObject

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

type ClusterScopeParams

type ClusterScopeParams struct {
	Client         client.Client
	Logger         *logr.Logger
	Cluster        *clusterv1.Cluster
	ProxmoxCluster *infrav1alpha1.ProxmoxCluster
	ProxmoxClient  proxmox.Client
	ControllerName string
	IPAMHelper     *ipam.Helper
}

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

type MachineScope

type MachineScope struct {
	*logr.Logger

	Cluster        *clusterv1.Cluster
	Machine        *clusterv1.Machine
	InfraCluster   *ClusterScope
	ProxmoxMachine *infrav1alpha1.ProxmoxMachine
	IPAMHelper     *ipam.Helper
	VirtualMachine *proxmox.VirtualMachine
	// 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) GetBootstrapSecret

func (m *MachineScope) GetBootstrapSecret(ctx context.Context, secret *corev1.Secret) error

GetBootstrapSecret obtains the bootstrap data secret.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the ProxmoxMachine providerID from the spec.

func (*MachineScope) GetVirtualMachineID

func (m *MachineScope) GetVirtualMachineID() int64

GetVirtualMachineID returns the ProxmoxMachine vmid from the spec.

func (*MachineScope) HasFailed

func (m *MachineScope) HasFailed() bool

HasFailed returns the failure state of the machine scope.

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) LocateProxmoxNode

func (m *MachineScope) LocateProxmoxNode() string

LocateProxmoxNode will attempt to get information about the currently deployed Proxmox node.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the ProxmoxMachine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the namespace name.

func (*MachineScope) PatchObject

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(addr []clusterv1.MachineAddress)

SetAddresses sets the addresses in the status.

func (*MachineScope) SetAnnotation

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

SetAnnotation sets a key value annotation on the ProxmoxMachine.

func (*MachineScope) SetFailureMessage

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the ProxmoxMachine status failure message.

func (*MachineScope) SetFailureReason

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

SetFailureReason sets the ProxmoxMachine status failure reason.

func (*MachineScope) SetNotReady

func (m *MachineScope) SetNotReady()

SetNotReady sets the ProxmoxMachine Ready Status to false.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(biosUUID string)

SetProviderID sets the ProxmoxMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the ProxmoxMachine Ready Status.

func (*MachineScope) SetVirtualMachine

func (m *MachineScope) SetVirtualMachine(vm *proxmox.VirtualMachine)

SetVirtualMachine sets the Proxmox VirtualMachine object to the machinescope.

func (*MachineScope) SetVirtualMachineID

func (m *MachineScope) SetVirtualMachineID(vmID int64)

SetVirtualMachineID sets the ProxmoxMachine instanceID in spec.

type MachineScopeParams

type MachineScopeParams struct {
	Client         client.Client
	Logger         *logr.Logger
	Cluster        *clusterv1.Cluster
	Machine        *clusterv1.Machine
	InfraCluster   *ClusterScope
	ProxmoxMachine *infrav1alpha1.ProxmoxMachine
	IPAMHelper     *ipam.Helper
}

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