apis

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package apis provides BareMetalHost utilities: status checks, provisioning state monitoring, and Metal3 operations.

Package apis provides Kubernetes API utilities: CSR approval, BareMetalHost status checks, and Metal3 operations.

Index

Constants

View Source
const (
	BMCSecretNamespace = "openshift-machine-api"
)

Variables

This section is empty.

Functions

func ApproveCSRs

func ApproveCSRs(oc *exutil.CLI, timeout time.Duration, pollInterval time.Duration, expectedCSRCount int) int

ApproveCSRs monitors and approves pending CSRs until timeout or expected count reached.

approvedCount := ApproveCSRs(oc, 10*time.Minute, 1*time.Minute, 0)

func FindBMCSecretByNodeName

func FindBMCSecretByNodeName(oc *exutil.CLI, namespace, nodeName string) (string, error)

FindBMCSecretByNodeName finds a BMC secret name matching the pattern *-{shortName}-bmc-secret. Handles both simple names (master-0) and FQDNs (master-0.ostest.test.metalkube.org).

func FindBMHByNodeName

func FindBMHByNodeName(oc *exutil.CLI, namespace, nodeName string) (string, error)

FindBMHByNodeName finds a BareMetalHost name matching the pattern *-{shortName} for a given node. Handles both simple names (master-0) and FQDNs (master-0.ostest.test.metalkube.org).

func GetBMH

func GetBMH(oc *exutil.CLI, bmhName, namespace string) (*metal3v1alpha1.BareMetalHost, error)

GetBMH retrieves and parses a BareMetalHost resource.

bmh, err := GetBMH(oc, "master-0", "openshift-machine-api")

func GetBMHErrorMessage

func GetBMHErrorMessage(oc *exutil.CLI, bmhName, namespace string) (string, error)

GetBMHErrorMessage retrieves the error message from a BareMetalHost's status.

errorMsg, err := GetBMHErrorMessage(oc, "master-0", "openshift-machine-api")

func GetBMHProvisioningState

func GetBMHProvisioningState(oc *exutil.CLI, bmhName, namespace string) (metal3v1alpha1.ProvisioningState, error)

GetBMHProvisioningState retrieves the current provisioning state of a BareMetalHost.

state, err := GetBMHProvisioningState(oc, "master-0", "openshift-machine-api")

func RestoreBMCPassword

func RestoreBMCPassword(oc *exutil.CLI, namespace, name string, originalPassword []byte) error

RestoreBMCPassword restores the password key on the given BMC Secret.

func RotateNodeBMCPassword

func RotateNodeBMCPassword(oc *exutil.CLI, node *corev1.Node) (string, string, []byte, error)

RotateNodeBMCPassword discovers the BMC Secret for the given node, rotates its "password" key and returns (namespace, secretName, originalPassword).

Types

This section is empty.

Jump to

Keyboard shortcuts

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