controllers

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package controllers contains Cluster API controllers for Tinkerbell.

Index

Constants

View Source
const (
	// HardwareOwnerNameLabel is a label set by either CAPT controllers or Tinkerbell controller to indicate
	// that given hardware takes part of at least one workflow.
	HardwareOwnerNameLabel = "v1alpha1.tinkerbell.org/ownerName"

	// HardwareOwnerNamespaceLabel is a label set by either CAPT controllers or Tinkerbell controller to indicate
	// that given hardware takes part of at least one workflow.
	HardwareOwnerNamespaceLabel = "v1alpha1.tinkerbell.org/ownerNamespace"

	// ClusterNameLabel is used to mark Hardware as assigned controlplane machine.
	ClusterNameLabel = "v1alpha1.tinkerbell.org/clusterName"

	// ClusterNamespaceLabel is used to mark in which Namespace hardware is used.
	ClusterNamespaceLabel = "v1alpha1.tinkerbell.org/clusterNamespace"

	// KubernetesAPIPort is a port used by Tinkerbell clusters for Kubernetes API.
	KubernetesAPIPort = 6443
)

Variables

View Source
var (
	// ErrMachineVersionEmpty is the error returned when Version is not set on the parent Machine.
	ErrMachineVersionEmpty = fmt.Errorf("machine version is empty")

	// ErrConfigurationNil is the error returned when TinkerbellMachineReconciler or TinkerbellClusterReconciler is nil.
	ErrConfigurationNil = fmt.Errorf("configuration is nil")

	// ErrMissingClient is the error returned when TinkerbellMachineReconciler or TinkerbellClusterReconciler do
	// not have a Client configured.
	ErrMissingClient = fmt.Errorf("client is nil")

	// ErrMissingBootstrapDataSecretValueKey is the error returned when the Secret referenced for bootstrap data
	// is missing the value key.
	ErrMissingBootstrapDataSecretValueKey = fmt.Errorf("retrieving bootstrap data: secret value key is missing")

	// ErrBootstrapUserDataEmpty is the error returned when the referenced bootstrap data is empty.
	ErrBootstrapUserDataEmpty = fmt.Errorf("received bootstrap user data is empty")

	// ErrHardwareMissingDiskConfiguration is returned when the referenced hardware is missing
	// disk configuration.
	ErrHardwareMissingDiskConfiguration = fmt.Errorf("disk configuration is required")
)
View Source
var (
	// ErrNoHardwareAvailable is the error returned when there is no hardware available for provisioning.
	ErrNoHardwareAvailable = fmt.Errorf("no hardware available")
	// ErrHardwareIsNil is the error returned when the given hardware resource is nil.
	ErrHardwareIsNil = fmt.Errorf("given Hardware object is nil")
	// ErrHardwareMissingInterfaces is the error returned when the referenced hardware does not have any
	// network interfaces defined.
	ErrHardwareMissingInterfaces = fmt.Errorf("hardware has no interfaces defined")
	// ErrHardwareFirstInterfaceNotDHCP is the error returned when the referenced hardware does not have it's
	// first network interface configured for DHCP.
	ErrHardwareFirstInterfaceNotDHCP = fmt.Errorf("hardware's first interface has no DHCP address defined")
	// ErrHardwareFirstInterfaceDHCPMissingIP is the error returned when the referenced hardware does not have a
	// DHCP IP address assigned for it's first interface.
	ErrHardwareFirstInterfaceDHCPMissingIP = fmt.Errorf("hardware's first interface has no DHCP IP address defined")
	// ErrClusterNotReady is returned when trying to reconcile prior to the Cluster resource being ready.
	ErrClusterNotReady = fmt.Errorf("cluster resource not ready")
	// ErrControlPlaneEndpointNotSet is returned when trying to reconcile when the ControlPlane Endpoint is not defined.
	ErrControlPlaneEndpointNotSet = fmt.Errorf("controlplane endpoint is not set")
)

Functions

This section is empty.

Types

type TinkerbellClusterReconciler

type TinkerbellClusterReconciler struct {
	client.Client
	WatchFilterValue string
}

TinkerbellClusterReconciler implements Reconciler interface.

func (*TinkerbellClusterReconciler) Reconcile

Reconcile ensures state of Tinkerbell clusters.

func (*TinkerbellClusterReconciler) SetupWithManager

func (tcr *TinkerbellClusterReconciler) SetupWithManager(
	ctx context.Context,
	mgr ctrl.Manager,
	options controller.Options,
) error

SetupWithManager configures reconciler with a given manager.

type TinkerbellMachineReconciler

type TinkerbellMachineReconciler struct {
	client.Client
	WatchFilterValue string
}

TinkerbellMachineReconciler implements Reconciler interface by managing Tinkerbell machines.

func (*TinkerbellMachineReconciler) Reconcile

Reconcile ensures that all Tinkerbell machines are aligned with a given spec.

func (*TinkerbellMachineReconciler) SetupWithManager

func (r *TinkerbellMachineReconciler) SetupWithManager(
	ctx context.Context,
	mgr ctrl.Manager,
	options controller.Options,
) error

SetupWithManager configures reconciler with a given manager.

func (*TinkerbellMachineReconciler) TinkerbellClusterToTinkerbellMachines

func (r *TinkerbellMachineReconciler) TinkerbellClusterToTinkerbellMachines(ctx context.Context) handler.MapFunc

TinkerbellClusterToTinkerbellMachines is a handler.ToRequestsFunc to be used to enqeue requests for reconciliation of TinkerbellMachines.

Jump to

Keyboard shortcuts

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