Documentation
¶
Overview ¶
Package scope defines the provider scopes for reconciliation.
Index ¶
- type Cluster
- func (c *Cluster) DeleteCurrentRequestByDatacenter(datacenterID string)
- func (c *Cluster) Finalize() error
- func (c *Cluster) GetControlPlaneEndpoint() clusterv1.APIEndpoint
- func (c *Cluster) GetControlPlaneEndpointIP(ctx context.Context) (string, error)
- func (c *Cluster) GetCurrentRequestByDatacenter(datacenterID string) (infrav1.ProvisioningRequest, bool)
- func (c *Cluster) IsDeleted() bool
- func (c *Cluster) ListMachines(ctx context.Context, machineLabels client.MatchingLabels) ([]infrav1.IonosCloudMachine, error)
- func (c *Cluster) Location() string
- func (c *Cluster) PatchObject() error
- func (c *Cluster) SetControlPlaneEndpointIPBlockID(id string)
- func (c *Cluster) SetCurrentRequestByDatacenter(datacenterID, method, status, requestPath string)
- type ClusterParams
- type Machine
- func (m *Machine) CountMachines(ctx context.Context, machineLabels client.MatchingLabels) (int, error)
- func (m *Machine) DatacenterID() string
- func (m *Machine) Finalize() error
- func (m *Machine) FindLatestMachine(ctx context.Context, matchLabels client.MatchingLabels) (*infrav1.IonosCloudMachine, error)
- func (m *Machine) GetBootstrapDataSecret(ctx context.Context, log logr.Logger) (*corev1.Secret, error)
- func (m *Machine) HasFailed() bool
- func (m *Machine) ListMachines(ctx context.Context, machineLabels client.MatchingLabels) ([]infrav1.IonosCloudMachine, error)
- func (m *Machine) PatchObject() error
- func (m *Machine) SetProviderID(id string)
- type MachineParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Locker *locker.Locker Cluster *clusterv1.Cluster IonosCluster *infrav1.IonosCloudCluster // contains filtered or unexported fields }
Cluster defines a basic cluster context for primary use in IonosCloudClusterReconciler.
func NewCluster ¶
func NewCluster(params ClusterParams) (*Cluster, error)
NewCluster creates a new cluster scope with the supplied parameters. This is meant to be called on each reconciliation.
func (*Cluster) DeleteCurrentRequestByDatacenter ¶
DeleteCurrentRequestByDatacenter deletes the current provisioning request for the given data center.
func (*Cluster) Finalize ¶
Finalize will make sure to apply a patch to the current IonosCloudCluster. It also implements a retry mechanism to increase the chance of success in case the patch operation was not successful.
func (*Cluster) GetControlPlaneEndpoint ¶
func (c *Cluster) GetControlPlaneEndpoint() clusterv1.APIEndpoint
GetControlPlaneEndpoint returns the endpoint for the IonosCloudCluster.
func (*Cluster) GetControlPlaneEndpointIP ¶
GetControlPlaneEndpointIP returns the endpoint IP for the IonosCloudCluster. If the endpoint host is unset (neither an IP nor an FQDN), it will return an empty string.
func (*Cluster) GetCurrentRequestByDatacenter ¶
func (c *Cluster) GetCurrentRequestByDatacenter(datacenterID string) (infrav1.ProvisioningRequest, bool)
GetCurrentRequestByDatacenter returns the current provisioning request for the given data center and a boolean indicating if it exists.
func (*Cluster) ListMachines ¶
func (c *Cluster) ListMachines( ctx context.Context, machineLabels client.MatchingLabels, ) ([]infrav1.IonosCloudMachine, error)
ListMachines returns a list of IonosCloudMachines in the same namespace and with the same cluster label. With machineLabels, additional search labels can be provided.
func (*Cluster) Location ¶
Location is a shortcut for getting the location used by the IONOS Cloud cluster IP block.
func (*Cluster) PatchObject ¶
PatchObject will apply all changes from the IonosCloudCluster. It will also make sure to patch the status subresource.
func (*Cluster) SetControlPlaneEndpointIPBlockID ¶
SetControlPlaneEndpointIPBlockID sets the IP block ID in the IonosCloudCluster status.
func (*Cluster) SetCurrentRequestByDatacenter ¶
SetCurrentRequestByDatacenter sets the current provisioning request for the given data center. This function makes sure that the map is initialized before setting the request.
type ClusterParams ¶
type ClusterParams struct { Client client.Client Cluster *clusterv1.Cluster IonosCluster *infrav1.IonosCloudCluster Locker *locker.Locker }
ClusterParams are the parameters, which are used to create a cluster scope.
type Machine ¶
type Machine struct { Locker *locker.Locker Machine *clusterv1.Machine IonosMachine *infrav1.IonosCloudMachine ClusterScope *Cluster // contains filtered or unexported fields }
Machine defines a basic machine context for primary use in IonosCloudMachineReconciler.
func NewMachine ¶
func NewMachine(params MachineParams) (*Machine, error)
NewMachine creates a new Machine using the provided params.
func (*Machine) CountMachines ¶
func (m *Machine) CountMachines(ctx context.Context, machineLabels client.MatchingLabels) (int, error)
CountMachines returns the number of existing IonosCloudMachines in the same namespace and with the same cluster label. With machineLabels, additional search labels can be provided.
func (*Machine) DatacenterID ¶
DatacenterID returns the data center ID used by the IonosCloudMachine.
func (*Machine) Finalize ¶
Finalize will make sure to apply a patch to the current IonosCloudMachine. It also implements a retry mechanism to increase the chance of success in case the patch operation was not successful.
func (*Machine) FindLatestMachine ¶
func (m *Machine) FindLatestMachine( ctx context.Context, matchLabels client.MatchingLabels, ) (*infrav1.IonosCloudMachine, error)
FindLatestMachine returns the latest IonosCloudMachine in the same namespace and with the same cluster label. If no machine was found, nil is returned.
Only machines, that are different to the receiver machine, are considered. If the receiver machine is the only machine in the list, nil is returned.
func (*Machine) GetBootstrapDataSecret ¶
func (m *Machine) GetBootstrapDataSecret(ctx context.Context, log logr.Logger) (*corev1.Secret, error)
GetBootstrapDataSecret returns the bootstrap data secret, which has been created by the Kubeadm provider.
func (*Machine) ListMachines ¶
func (m *Machine) ListMachines( ctx context.Context, machineLabels client.MatchingLabels, ) ([]infrav1.IonosCloudMachine, error)
ListMachines is a convenience wrapper function for the Cluster.ListMachines function.
func (*Machine) PatchObject ¶
PatchObject will apply all changes from the IonosMachine. It will also make sure to patch the status subresource.
func (*Machine) SetProviderID ¶
SetProviderID sets the provider ID for the IonosCloudMachine.