Documentation ¶
Overview ¶
Package scope defines the capmox scopes used for reconciliation.
Index ¶
- type ClusterScope
- func (s *ClusterScope) Close() error
- func (s *ClusterScope) InfraClusterName() string
- func (s *ClusterScope) KubernetesClusterName() string
- func (s *ClusterScope) ListProxmoxMachinesForCluster(ctx context.Context) ([]infrav1alpha1.ProxmoxMachine, error)
- func (s *ClusterScope) Name() string
- func (s *ClusterScope) Namespace() string
- func (s *ClusterScope) PatchObject() error
- type ClusterScopeParams
- type MachineScope
- func (m *MachineScope) Close() error
- func (m *MachineScope) GetBootstrapSecret(ctx context.Context, secret *corev1.Secret) error
- func (m *MachineScope) GetProviderID() string
- func (m *MachineScope) GetVirtualMachineID() int64
- func (m *MachineScope) HasFailed() bool
- func (m *MachineScope) IsControlPlane() bool
- func (m *MachineScope) LocateProxmoxNode() string
- func (m *MachineScope) Name() string
- func (m *MachineScope) Namespace() string
- func (m *MachineScope) PatchObject() error
- func (m *MachineScope) Role() string
- func (m *MachineScope) SetAddresses(addr []clusterv1.MachineAddress)
- func (m *MachineScope) SetAnnotation(key, value string)
- func (m *MachineScope) SetFailureMessage(v error)
- func (m *MachineScope) SetFailureReason(v capierrors.MachineStatusError)
- func (m *MachineScope) SetNotReady()
- func (m *MachineScope) SetProviderID(biosUUID string)
- func (m *MachineScope) SetReady()
- func (m *MachineScope) SetVirtualMachine(vm *proxmox.VirtualMachine)
- func (m *MachineScope) SetVirtualMachineID(vmID int64)
- func (m *MachineScope) SkipCloudInitCheck() bool
- func (m *MachineScope) SkipQemuGuestCheck() bool
- type MachineScopeParams
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 capmox.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) 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) ListProxmoxMachinesForCluster ¶ added in v0.6.0
func (s *ClusterScope) ListProxmoxMachinesForCluster(ctx context.Context) ([]infrav1alpha1.ProxmoxMachine, error)
ListProxmoxMachinesForCluster returns all the ProxmoxMachines that belong to this cluster.
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 capmox.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 ¶
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.
func (*MachineScope) SkipCloudInitCheck ¶ added in v0.6.0
func (m *MachineScope) SkipCloudInitCheck() bool
SkipCloudInitCheck check whether cloud-init status check is enabled.
func (*MachineScope) SkipQemuGuestCheck ¶ added in v0.6.0
func (m *MachineScope) SkipQemuGuestCheck() bool
SkipQemuGuestCheck check whether qemu-agent status check is enabled.
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.