framework

package
v0.0.0-...-8342a83 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CAPINamespace = "openshift-cluster-api"
	MAPINamespace = "openshift-machine-api"

	RetryShort  = 1 * time.Second
	RetryMedium = 5 * time.Second
)

Variables

View Source
var (
	WaitShort    = 1 * time.Minute
	WaitMedium   = 3 * time.Minute
	WaitLong     = 15 * time.Minute
	WaitOverLong = 30 * time.Minute
)

Functions

func CreateCoreCluster

func CreateCoreCluster(cl client.Client, clusterName, infraClusterKind string) *clusterv1.Cluster

CreateCluster creates a cluster with the given name and returns the cluster object.

func CreateMachineSet

func CreateMachineSet(cl client.Client, params machineSetParams) *clusterv1.MachineSet

CreateMachineSet creates a new MachineSet resource.

func DeleteMachineSets

func DeleteMachineSets(cl client.Client, machineSets ...*clusterv1.MachineSet)

DeleteMachineSets deletes the specified machinesets and returns an error on failure.

func DeleteObjects

func DeleteObjects(cl client.Client, objs ...client.Object)

DeleteObjects deletes the objects in the given list.

func FilterRunningMachines

func FilterRunningMachines(machines []*clusterv1.Machine) []*clusterv1.Machine

FilterRunningMachines returns a slice of only those Machines in the input that are in the "Running" phase.

func GetControlPlaneHostAndPort

func GetControlPlaneHostAndPort(cl client.Client) (string, int32, error)

func GetMachineSet

func GetMachineSet(cl client.Client, name string) (*clusterv1.MachineSet, error)

GetMachineSet gets a machineset by its name from the default machine API namespace.

func GetMachines

func GetMachines(cl client.Client, selectors ...*metav1.LabelSelector) ([]*clusterv1.Machine, error)

GetMachines gets a list of machines from the default cluster API namespace. Optionaly, labels may be used to constrain listed machinesets.

func GetMachinesFromMachineSet

func GetMachinesFromMachineSet(cl client.Client, machineSet *clusterv1.MachineSet) ([]*clusterv1.Machine, error)

GetMachinesFromMachineSet returns an array of machines owned by a given machineSet

func GetNodeForMachine

func GetNodeForMachine(cl client.Client, m *clusterv1.Machine) (*corev1.Node, error)

GetNodeForMachine retrieves the node backing the given Machine.

func NewMachineSetParams

func NewMachineSetParams(msName, clusterName, failureDomain string, replicas int32, infrastructureRef corev1.ObjectReference) machineSetParams

NewMachineSetParams returns a new machineSetParams object.

func WaitForMachineSet

func WaitForMachineSet(cl client.Client, name string)

WaitForMachineSet waits for the all Machines belonging to the named MachineSet to enter the "Running" phase, and for all nodes belonging to those Machines to be ready.

func WaitForMachineSetsDeleted

func WaitForMachineSetsDeleted(cl client.Client, machineSets ...*clusterv1.MachineSet)

WaitForMachineSetsDeleted polls until the given MachineSets are not found, and there are zero Machines found matching the MachineSet's label selector.

Types

This section is empty.

Jump to

Keyboard shortcuts

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