baremetal

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName is exported
	ProviderName = "baremetal"
	// HostAnnotation is the key for an annotation that should go on a Machine to
	// reference what BareMetalHost it corresponds to.
	HostAnnotation = "metal3.io/BareMetalHost"
)
View Source
const (
	APIEndpointPort = "6443"
)

Constant variables

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientGetter

type ClientGetter func(c client.Client, cluster *capi.Cluster) (clientcorev1.CoreV1Interface, error)

type ClusterManager

type ClusterManager struct {
	Cluster          *capi.Cluster
	BareMetalCluster *capbm.BareMetalCluster
	Log              logr.Logger
	// contains filtered or unexported fields
}

ClusterManager is responsible for performing machine reconciliation

func (*ClusterManager) CountDescendants

func (s *ClusterManager) CountDescendants(ctx context.Context) (int, error)

CountDescendants will return the number of descendants objects of the BaremetalCluster

func (*ClusterManager) Create

func (s *ClusterManager) Create(ctx context.Context) error

Create creates a cluster manager for the cluster.

func (*ClusterManager) Delete

func (s *ClusterManager) Delete() error

Delete function, no-op for now

func (*ClusterManager) SetFinalizer

func (s *ClusterManager) SetFinalizer()

SetFinalizer sets finalizer

func (*ClusterManager) UnsetFinalizer

func (s *ClusterManager) UnsetFinalizer()

UnsetFinalizer unsets finalizer

func (*ClusterManager) UpdateClusterStatus

func (s *ClusterManager) UpdateClusterStatus() error

UpdateClusterStatus updates a machine object's status.

type ClusterManagerInterface

type ClusterManagerInterface interface {
	Create(context.Context) error
	Delete() error
	UpdateClusterStatus() error
	SetFinalizer()
	UnsetFinalizer()
	CountDescendants(context.Context) (int, error)
}

ClusterManagerInterface is an interface for a ClusterManager

func NewClusterManager

func NewClusterManager(client client.Client, cluster *capi.Cluster,
	bareMetalCluster *capbm.BareMetalCluster,
	clusterLog logr.Logger) (ClusterManagerInterface, error)

NewClusterManager returns a new helper for managing a cluster with a given name.

type HasRequeueAfterError

type HasRequeueAfterError interface {
	// GetRequeueAfter gets the duration to wait until the managed object is
	// requeued for further processing.
	GetRequeueAfter() time.Duration
}

HasRequeueAfterError represents that an actuator managed object should be requeued for further processing after the given RequeueAfter time has passed.

type MachineManager

type MachineManager struct {
	Cluster          *capi.Cluster
	BareMetalCluster *capbm.BareMetalCluster
	Machine          *capi.Machine
	BareMetalMachine *capbm.BareMetalMachine
	Log              logr.Logger
	// contains filtered or unexported fields
}

MachineManager is responsible for performing machine reconciliation

func NewMachineManager

func NewMachineManager(client client.Client,
	cluster *capi.Cluster, baremetalCluster *capbm.BareMetalCluster,
	machine *capi.Machine, baremetalMachine *capbm.BareMetalMachine,
	machineLog logr.Logger) (*MachineManager, error)

NewMachineManager returns a new helper for managing a machine

func (*MachineManager) Associate

func (m *MachineManager) Associate(ctx context.Context) error

Associate associates a machine and is invoked by the Machine Controller

func (*MachineManager) Delete

func (m *MachineManager) Delete(ctx context.Context) error

Delete deletes a bare metal machine and is invoked by the Machine Controller

func (*MachineManager) GetBaremetalHostID

func (m *MachineManager) GetBaremetalHostID(ctx context.Context) (*string, error)

GetBaremetalHostID return the provider identifier for this machine

func (*MachineManager) HasAnnotation

func (m *MachineManager) HasAnnotation() bool

HasAnnotation makes sure the machine has an annotation that references a host

func (*MachineManager) IsBootstrapReady

func (m *MachineManager) IsBootstrapReady() bool

IsBootstrapReady checks if the machine is given Bootstrap data

func (*MachineManager) IsProvisioned

func (m *MachineManager) IsProvisioned() bool

IsProvisioned checks if the machine is provisioned

func (*MachineManager) SetFinalizer

func (m *MachineManager) SetFinalizer()

SetFinalizer sets finalizer

func (*MachineManager) SetNodeProviderID

func (m *MachineManager) SetNodeProviderID(bmhID, providerID string, clientFactory ClientGetter) error

SetNodeProviderID sets the bare metal provider ID on the kubernetes node

func (*MachineManager) SetProviderID

func (m *MachineManager) SetProviderID(providerID string)

SetProviderID sets the bare metal provider ID on the BaremetalMachine

func (*MachineManager) UnsetFinalizer

func (m *MachineManager) UnsetFinalizer()

UnsetFinalizer unsets finalizer

func (*MachineManager) Update

func (m *MachineManager) Update(ctx context.Context) error

Update updates a machine and is invoked by the Machine Controller

type MachineManagerInterface

type MachineManagerInterface interface {
	SetFinalizer()
	UnsetFinalizer()
	IsProvisioned() bool
	IsBootstrapReady() bool
	GetBaremetalHostID(context.Context) (*string, error)
	Associate(context.Context) error
	Delete(context.Context) error
	Update(context.Context) error
	HasAnnotation() bool
	SetNodeProviderID(string, string, ClientGetter) error
	SetProviderID(string)
}

ClusterManagerInterface is an interface for a ClusterManager

type ManagerFactory

type ManagerFactory struct {
	// contains filtered or unexported fields
}

ManagerFactory only contains a client

func NewManagerFactory

func NewManagerFactory(client client.Client) ManagerFactory

NewManagerFactory returns a new factory.

func (ManagerFactory) NewClusterManager

func (f ManagerFactory) NewClusterManager(cluster *capi.Cluster, capbmCluster *capbm.BareMetalCluster, clusterLog logr.Logger) (ClusterManagerInterface, error)

NewClusterManager creates a new ClusterManager

func (ManagerFactory) NewMachineManager

func (f ManagerFactory) NewMachineManager(capiCluster *capi.Cluster,
	capbmCluster *capbm.BareMetalCluster,
	capiMachine *capi.Machine, capbmMachine *capbm.BareMetalMachine,
	machineLog logr.Logger) (MachineManagerInterface, error)

NewMachineManager creates a new MachineManager

type ManagerFactoryInterface

type ManagerFactoryInterface interface {
	NewClusterManager(cluster *capi.Cluster,
		bareMetalCluster *capbm.BareMetalCluster,
		clusterLog logr.Logger) (ClusterManagerInterface, error)
	NewMachineManager(*capi.Cluster, *capbm.BareMetalCluster, *capi.Machine,
		*capbm.BareMetalMachine, logr.Logger) (MachineManagerInterface, error)
}

type RequeueAfterError

type RequeueAfterError struct {
	RequeueAfter time.Duration
}

RequeueAfterError represents that an actuator managed object should be requeued for further processing after the given RequeueAfter time has passed.

func (*RequeueAfterError) Error

func (e *RequeueAfterError) Error() string

Error implements the error interface

func (*RequeueAfterError) GetRequeueAfter

func (e *RequeueAfterError) GetRequeueAfter() time.Duration

GetRequeueAfter gets the duration to wait until the managed object is requeued for further processing.

Directories

Path Synopsis
Package baremetal_mocks is a generated GoMock package.
Package baremetal_mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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