Documentation ¶
Index ¶
- func AnnotateBmh(ctx context.Context, client client.Client, host bmov1alpha1.BareMetalHost, ...)
- func BmhToVMName(host bmov1alpha1.BareMetalHost) string
- func Byf(format string, a ...interface{})
- func DeleteNodeReuseLabelFromHost(ctx context.Context, client client.Client, host bmov1alpha1.BareMetalHost, ...)
- func DeploymentRolledOut(ctx context.Context, clientSet *kubernetes.Clientset, name string, ...) bool
- func DownloadFile(filePath string, url string) error
- func DumpSpecResourcesAndCleanup(ctx context.Context, specName string, clusterProxy framework.ClusterProxy, ...)
- func FilterBmhsByProvisioningState(bmhs []bmov1alpha1.BareMetalHost, state bmov1alpha1.ProvisioningState) (result []bmov1alpha1.BareMetalHost)
- func FilterMachines(machines []clusterv1.Machine, accept func(clusterv1.Machine) bool) (result []clusterv1.Machine)
- func FilterMachinesByPhase(machines []clusterv1.Machine, phase clusterv1.MachinePhase) (result []clusterv1.Machine)
- func FilterNodeCondition(conditions []corev1.NodeCondition, conditionType corev1.NodeConditionType) []corev1.NodeCondition
- func GetAllBmhs(ctx context.Context, c client.Client, namespace string) ([]bmov1alpha1.BareMetalHost, error)
- func GetMachine(ctx context.Context, c client.Client, name client.ObjectKey) (result clusterv1.Machine)
- func GetMetal3Machines(ctx context.Context, c client.Client, cluster, namespace string) ([]infrav1.Metal3Machine, []infrav1.Metal3Machine)
- func ListBareMetalHosts(ctx context.Context, c client.Client, opts ...client.ListOption)
- func ListMachines(ctx context.Context, c client.Client, opts ...client.ListOption)
- func ListMetal3Machines(ctx context.Context, c client.Client, opts ...client.ListOption)
- func ListNodes(ctx context.Context, c client.Client)
- func LogFromFile(logFile string)
- func Logf(format string, a ...interface{})
- func Metal3MachineToBmhName(m3machine infrav1.Metal3Machine) string
- func Metal3MachineToMachineName(m3machine infrav1.Metal3Machine) (string, error)
- func ScaleKubeadmControlPlane(ctx context.Context, c client.Client, name client.ObjectKey, ...)
- func ScaleMachineDeployment(ctx context.Context, clusterClient client.Client, ...)
- func WaitForNumBmhInState(ctx context.Context, state bmov1alpha1.ProvisioningState, ...)
- func WaitForNumMachines(ctx context.Context, accept func(clusterv1.Machine) bool, ...)
- func WaitForNumMachinesInState(ctx context.Context, phase clusterv1.MachinePhase, input WaitForNumInput)
- func WaitForNumMetal3MachinesReady(ctx context.Context, input WaitForNumInput)
- type WaitForNumInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateBmh ¶
func AnnotateBmh(ctx context.Context, client client.Client, host bmov1alpha1.BareMetalHost, key string, value *string)
AnnotateBmh annotates BaremetalHost with a given key and value.
func BmhToVMName ¶
func BmhToVMName(host bmov1alpha1.BareMetalHost) string
Derives the name of a VM created by metal3-dev-env from the name of a BareMetalHost object.
func DeleteNodeReuseLabelFromHost ¶
func DeleteNodeReuseLabelFromHost(ctx context.Context, client client.Client, host bmov1alpha1.BareMetalHost, nodeReuseLabelName string)
DeleteNodeReuseLabelFromHost deletes nodeReuseLabelName from the host if it exists.
func DeploymentRolledOut ¶
func DownloadFile ¶
DownloadFile will download a url and store it in local filepath.
func FilterBmhsByProvisioningState ¶
func FilterBmhsByProvisioningState(bmhs []bmov1alpha1.BareMetalHost, state bmov1alpha1.ProvisioningState) (result []bmov1alpha1.BareMetalHost)
FilterBmhsByProvisioningState returns a filtered list of BaremetalHost objects in certain provisioning state.
func FilterMachines ¶
func FilterMachines(machines []clusterv1.Machine, accept func(clusterv1.Machine) bool) (result []clusterv1.Machine)
FilterMachines returns a filtered list of Machines that were accepted by the accept function.
func FilterMachinesByPhase ¶
func FilterMachinesByPhase(machines []clusterv1.Machine, phase clusterv1.MachinePhase) (result []clusterv1.Machine)
FilterMachinesByPhase returns a filtered list of CAPI machine objects in certain desired phase.
func FilterNodeCondition ¶
func FilterNodeCondition(conditions []corev1.NodeCondition, conditionType corev1.NodeConditionType) []corev1.NodeCondition
FilterNodeCondition will filter the slice of NodeConditions so that only the given conditionType remains and return the resulting slice.
func GetAllBmhs ¶
func GetAllBmhs(ctx context.Context, c client.Client, namespace string) ([]bmov1alpha1.BareMetalHost, error)
func GetMachine ¶
func GetMachine(ctx context.Context, c client.Client, name client.ObjectKey) (result clusterv1.Machine)
Get the machine object given its object name.
func GetMetal3Machines ¶
func GetMetal3Machines(ctx context.Context, c client.Client, cluster, namespace string) ([]infrav1.Metal3Machine, []infrav1.Metal3Machine)
func ListBareMetalHosts ¶
ListBareMetalHosts logs the names, provisioning status, consumer and power status of all BareMetalHosts matching the opts. Similar to kubectl get baremetalhosts.
func ListMachines ¶
ListMachines logs the names, status phase, provider ID and Kubernetes version of all Machines in the namespace. Similar to kubectl get machines.
func ListMetal3Machines ¶
ListMetal3Machines logs the names, ready status and provider ID of all Metal3Machines in the namespace. Similar to kubectl get metal3machines.
func ListNodes ¶
ListNodes logs the names, status and Kubernetes version of all Nodes. Similar to kubectl get nodes.
func LogFromFile ¶
func LogFromFile(logFile string)
func Metal3MachineToBmhName ¶
func Metal3MachineToBmhName(m3machine infrav1.Metal3Machine) string
func Metal3MachineToMachineName ¶
func Metal3MachineToMachineName(m3machine infrav1.Metal3Machine) (string, error)
Metal3MachineToMachineName finds the relevant owner reference in Metal3Machine and returns the name of corresponding Machine.
func ScaleKubeadmControlPlane ¶
func ScaleKubeadmControlPlane(ctx context.Context, c client.Client, name client.ObjectKey, newReplicaCount int)
ScaleKubeadmControlPlane scales up/down KubeadmControlPlane object to desired replicas.
func ScaleMachineDeployment ¶
func ScaleMachineDeployment(ctx context.Context, clusterClient client.Client, clusterName, namespace string, newReplicas int)
ScaleMachineDeployment scales up/down MachineDeployment object to desired replicas.
func WaitForNumBmhInState ¶
func WaitForNumBmhInState(ctx context.Context, state bmov1alpha1.ProvisioningState, input WaitForNumInput)
WaitForNumBmhInState will wait for the given number of BMHs to be in the given state.
func WaitForNumMachines ¶
func WaitForNumMachines(ctx context.Context, accept func(clusterv1.Machine) bool, input WaitForNumInput)
WaitForNumMachines will wait for the given number of Machines to be accepted by the accept function. This is a more generic function than WaitForNumMachinesInState. It can be used to wait for any condition, e.g. that the Kubernetes version is correct.
func WaitForNumMachinesInState ¶
func WaitForNumMachinesInState(ctx context.Context, phase clusterv1.MachinePhase, input WaitForNumInput)
WaitForNumMachinesInState will wait for the given number of Machines to be in the given state.
func WaitForNumMetal3MachinesReady ¶
func WaitForNumMetal3MachinesReady(ctx context.Context, input WaitForNumInput)
WaitForNumMetal3MachinesReady will wait for the given number of M3Ms to be ready.
Types ¶
type WaitForNumInput ¶
type WaitForNumInput struct { Client client.Client Options []client.ListOption Replicas int Intervals []interface{} }