e2e

package
v0.0.0-...-8899c92 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

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 Byf

func Byf(format string, a ...interface{})

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 DeploymentRolledOut(ctx context.Context, clientSet *kubernetes.Clientset, name string, namespace string, desiredGeneration int64) bool

func DownloadFile

func DownloadFile(filePath string, url string) error

DownloadFile will download a url and store it in local filepath.

func DumpSpecResourcesAndCleanup

func DumpSpecResourcesAndCleanup(ctx context.Context, specName string, clusterProxy framework.ClusterProxy, artifactFolder string, namespace string, intervalsGetter func(spec, key string) []interface{}, clusterName, clusterctlLogFolder string, skipCleanup bool)

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

func ListBareMetalHosts(ctx context.Context, c client.Client, opts ...client.ListOption)

ListBareMetalHosts logs the names, provisioning status, consumer and power status of all BareMetalHosts matching the opts. Similar to kubectl get baremetalhosts.

func ListMachines

func ListMachines(ctx context.Context, c client.Client, opts ...client.ListOption)

ListMachines logs the names, status phase, provider ID and Kubernetes version of all Machines in the namespace. Similar to kubectl get machines.

func ListMetal3Machines

func ListMetal3Machines(ctx context.Context, c client.Client, opts ...client.ListOption)

ListMetal3Machines logs the names, ready status and provider ID of all Metal3Machines in the namespace. Similar to kubectl get metal3machines.

func ListNodes

func ListNodes(ctx context.Context, c client.Client)

ListNodes logs the names, status and Kubernetes version of all Nodes. Similar to kubectl get nodes.

func LogFromFile

func LogFromFile(logFile string)

func Logf

func Logf(format string, a ...interface{})

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{}
}

Jump to

Keyboard shortcuts

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