Documentation
¶
Index ¶
- Constants
- Variables
- type Adaptor
- func (a *Adaptor) ApplyPostConfigUpdates(ctx context.Context, bmhName types.NamespacedName, node *hwmgmtv1alpha1.Node) error
- func (a *Adaptor) CheckNodePoolProgress(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) (full bool, err error)
- func (a *Adaptor) CreateNode(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool, ...) error
- func (a *Adaptor) FetchBMHList(ctx context.Context, site string, nodePoolData hwmgmtv1alpha1.NodePoolData, ...) (metal3v1alpha1.BareMetalHostList, error)
- func (a *Adaptor) GetNodeList(ctx context.Context) (*hwmgmtv1alpha1.NodeList, error)
- func (a *Adaptor) GetResourcePools(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager) ([]invserver.ResourcePoolInfo, int, error)
- func (a *Adaptor) GetResources(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager) ([]invserver.ResourceInfo, int, error)
- func (a *Adaptor) GroupBMHsByResourcePool(unallocatedBMHs metal3v1alpha1.BareMetalHostList) map[string][]metal3v1alpha1.BareMetalHost
- func (a *Adaptor) HandleNodePool(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) (ctrl.Result, error)
- func (a *Adaptor) HandleNodePoolCreate(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) (ctrl.Result, error)
- func (a *Adaptor) HandleNodePoolDeletion(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) (bool, error)
- func (a *Adaptor) HandleNodePoolProcessing(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) (ctrl.Result, error)
- func (a *Adaptor) HandleNodePoolSpecChanged(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) (ctrl.Result, error)
- func (a *Adaptor) IsBiosUpdateRequired(ctx context.Context, bmh *metal3v1alpha1.BareMetalHost, ...) (bool, error)
- func (a *Adaptor) IsFirmwareUpdateRequired(ctx context.Context, bmh *metal3v1alpha1.BareMetalHost, ...) (bool, error)
- func (a *Adaptor) IsNodePoolFullyAllocated(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) (bool, error)
- func (a *Adaptor) ProcessNewNodePool(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) error
- func (a *Adaptor) ProcessNodePoolAllocation(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) error
- func (a *Adaptor) ReleaseNodePool(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, ...) error
- func (a *Adaptor) SetupAdaptor(mgr ctrl.Manager) error
- func (a *Adaptor) UpdateNodeStatus(ctx context.Context, info bmhNodeInfo, nodename, hwprofile string, ...) error
- type BMHAllocationStatus
Constants ¶
const ( NodePoolFSMCreate = iota NodePoolFSMProcessing NodePoolFSMSpecChanged NodePoolFSMNoop )
const ( BmhDay2ConfigAnnotation = "bmac.agent-install.openshift.io/day2-configuration-status" BmhDetachedAnnotation = "baremetalhost.metal3.io/detached" BmhPausedAnnotation = "baremetalhost.metal3.io/paused" BmhRebootAnnotation = "reboot.metal3.io" BiosUpdateNeededAnnotation = "hwmgr-plugin.oran.openshift.io/bios-update-needed" FirmwareUpdateNeededAnnotation = "hwmgr-plugin.oran.openshift.io/firmware-update-needed" BmhNamespaceLabel = "baremetalhost.metal3.io/namespace" BmhAllocatedLabel = "hwmgr-plugin.oran.openshift.io/allocated" Metal3Finalizer = "preprovisioningimage.metal3.io" UpdateReasonBIOSSettings = "bios-settings-update" UpdateReasonFirmware = "firmware-update" ValueTrue = "true" MetaTypeLabel = "label" MetaTypeAnnotation = "annotation" OpAdd = "add" OpRemove = "remove" )
const ( LabelPrefixResources = "resources.oran.openshift.io/" LabelResourcePoolID = LabelPrefixResources + "resourcePoolId" LabelSiteID = LabelPrefixResources + "siteId" LabelPrefixResourceSelector = "resourceselector.oran.openshift.io/" LabelPrefixInterfaces = "interfacelabel.oran.openshift.io/" )
Variables ¶
var REPatternInterfaceLabel = regexp.MustCompile(`^` + LabelPrefixInterfaces + `(.*)`)
The following regex pattern is used to find interface labels
var REPatternResourceSelectorLabel = regexp.MustCompile(`^` + LabelPrefixResourceSelector)
The following regex pattern is used to check resourceselector label pattern
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶
type Adaptor struct { client.Client NoncachedClient client.Reader Scheme *runtime.Scheme Logger *slog.Logger Namespace string AdaptorID pluginv1alpha1.HardwareManagerAdaptorID }
func NewAdaptor ¶
func (*Adaptor) ApplyPostConfigUpdates ¶
func (a *Adaptor) ApplyPostConfigUpdates(ctx context.Context, bmhName types.NamespacedName, node *hwmgmtv1alpha1.Node) error
func (*Adaptor) CheckNodePoolProgress ¶
func (a *Adaptor) CheckNodePoolProgress( ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) (full bool, err error)
CheckNodePoolProgress checks to see if a NodePool is fully allocated, allocating additional resources as needed
func (*Adaptor) CreateNode ¶
func (a *Adaptor) CreateNode(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool, cloudID, nodename, nodeId, nodeNs, groupname, hwprofile string) error
CreateNode creates a Node CR with specified attributes
func (*Adaptor) FetchBMHList ¶
func (a *Adaptor) FetchBMHList( ctx context.Context, site string, nodePoolData hwmgmtv1alpha1.NodePoolData, allocationStatus BMHAllocationStatus, namespace string) (metal3v1alpha1.BareMetalHostList, error)
FetchBMHList retrieves BareMetalHosts filtered by site ID, allocation status, and optional namespace.
func (*Adaptor) GetNodeList ¶
GetNodeList retrieves the node list
func (*Adaptor) GetResourcePools ¶
func (a *Adaptor) GetResourcePools(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager) ([]invserver.ResourcePoolInfo, int, error)
func (*Adaptor) GetResources ¶
func (a *Adaptor) GetResources(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager) ([]invserver.ResourceInfo, int, error)
func (*Adaptor) GroupBMHsByResourcePool ¶
func (a *Adaptor) GroupBMHsByResourcePool(unallocatedBMHs metal3v1alpha1.BareMetalHostList) map[string][]metal3v1alpha1.BareMetalHost
GroupBMHsByResourcePool groups unallocated BMHs by resource pool ID.
func (*Adaptor) HandleNodePool ¶
func (a *Adaptor) HandleNodePool(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) (ctrl.Result, error)
func (*Adaptor) HandleNodePoolCreate ¶
func (a *Adaptor) HandleNodePoolCreate( ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) (ctrl.Result, error)
func (*Adaptor) HandleNodePoolDeletion ¶
func (a *Adaptor) HandleNodePoolDeletion(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) (bool, error)
func (*Adaptor) HandleNodePoolProcessing ¶
func (a *Adaptor) HandleNodePoolProcessing( ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) (ctrl.Result, error)
func (*Adaptor) HandleNodePoolSpecChanged ¶
func (a *Adaptor) HandleNodePoolSpecChanged( ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) (ctrl.Result, error)
func (*Adaptor) IsBiosUpdateRequired ¶
func (a *Adaptor) IsBiosUpdateRequired(ctx context.Context, bmh *metal3v1alpha1.BareMetalHost, biosSettings pluginv1alpha1.Bios) (bool, error)
func (*Adaptor) IsFirmwareUpdateRequired ¶
func (a *Adaptor) IsFirmwareUpdateRequired(ctx context.Context, bmh *metal3v1alpha1.BareMetalHost, spec pluginv1alpha1.HardwareProfileSpec) (bool, error)
func (*Adaptor) IsNodePoolFullyAllocated ¶
func (a *Adaptor) IsNodePoolFullyAllocated(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) (bool, error)
IsNodePoolFullyAllocated checks to see if a NodePool CR has been fully allocated
func (*Adaptor) ProcessNewNodePool ¶
func (a *Adaptor) ProcessNewNodePool(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) error
ProcessNewNodePool processes a new NodePool CR, verifying that there are enough free resources to satisfy the request
func (*Adaptor) ProcessNodePoolAllocation ¶
func (a *Adaptor) ProcessNodePoolAllocation(ctx context.Context, nodepool *hwmgmtv1alpha1.NodePool) error
ProcessNodePoolAllocation allocates BareMetalHosts to a NodePool while ensuring all BMHs are in the same namespace.
func (*Adaptor) ReleaseNodePool ¶
func (a *Adaptor) ReleaseNodePool(ctx context.Context, hwmgr *pluginv1alpha1.HardwareManager, nodepool *hwmgmtv1alpha1.NodePool) error
ReleaseNodePool frees resources allocated to a NodePool
func (*Adaptor) SetupAdaptor ¶
SetupAdaptor sets up the metal3 adaptor
type BMHAllocationStatus ¶
type BMHAllocationStatus string
BMHAllocationStatus defines filtering options for FetchBMHList
const ( AllBMHs BMHAllocationStatus = "all" UnallocatedBMHs BMHAllocationStatus = "unallocated" AllocatedBMHs BMHAllocationStatus = "allocated" )