Documentation
¶
Index ¶
- Constants
- Variables
- func CreateCoreCluster(ctx context.Context, cl client.Client, clusterName, infraClusterKind string) *clusterv1.Cluster
- func CreateMachineSet(ctx context.Context, cl client.Client, params machineSetParams) *clusterv1.MachineSet
- func DeleteMachineSets(ctx context.Context, cl client.Client, machineSets ...*clusterv1.MachineSet)
- func DeleteMachines(ctx context.Context, cl client.Client, namespace string, ...)
- func DeleteObjects(ctx context.Context, cl client.Client, objs ...client.Object)
- func GetAWSMachine(name string, namespace string) (*awsv1.AWSMachine, error)
- func GetAWSMachineWithRetry(name string, namespace string) *awsv1.AWSMachine
- func GetControlPlaneHostAndPort(ctx context.Context, cl client.Client) (string, int32, error)
- func GetFirstMAPIMachineSet(ctx context.Context, cl client.Client) *mapiv1beta1.MachineSet
- func GetMAPIProviderSpec[T any](ctx context.Context, cl client.Client) *T
- func GetMachine(name string, namespace string) (*clusterv1.Machine, error)
- func GetMachineSet(name string, namespace string) (*clusterv1.MachineSet, error)
- func GetMachineSetWithRetry(name string, namespace string) *clusterv1.MachineSet
- func GetMachineWithRetry(name string, namespace string) *clusterv1.Machine
- func GetMachines(selectors ...*metav1.LabelSelector) []*clusterv1.Machine
- func GetMachinesFromMachineSet(machineSet *clusterv1.MachineSet) []*clusterv1.Machine
- func GetNewestMachineFromMachineSet(machineSet *clusterv1.MachineSet) *clusterv1.Machine
- func GetNodeForMachine(ctx context.Context, cl client.Client, m *clusterv1.Machine) (*corev1.Node, error)
- func IsFeatureGateEnabled(ctx context.Context, cl client.Client, name configv1.FeatureGateName) bool
- func NewMachineSetParams(msName, clusterName, failureDomain string, replicas int32, ...) machineSetParams
- func ScaleCAPIMachineSet(name string, replicas int32, namespace string)
- func SortListByName(list client.ObjectList)
- func WaitForMachineSet(ctx context.Context, cl client.Client, name string, namespace string, ...)
- func WaitForMachineSetsDeleted(machineSets ...*clusterv1.MachineSet)
Constants ¶
const ( CAPINamespace = "openshift-cluster-api" CAPIOperatorNamespace = "openshift-cluster-api-operator" CompatibilityRequirementsNamespace = "openshift-compatibility-requirements-operator" MAPINamespace = "openshift-machine-api" RetryShort = 1 * time.Second RetryMedium = 5 * time.Second RetryLong = 10 * time.Second )
Variables ¶
Functions ¶
func CreateCoreCluster ¶
func CreateCoreCluster(ctx context.Context, cl client.Client, clusterName, infraClusterKind string) *clusterv1.Cluster
CreateCoreCluster creates a cluster with the given name and returns the cluster object.
func CreateMachineSet ¶
func CreateMachineSet(ctx context.Context, cl client.Client, params machineSetParams) *clusterv1.MachineSet
CreateMachineSet creates a new CAPI MachineSet resource.
func DeleteMachineSets ¶
func DeleteMachines ¶
func DeleteMachines(ctx context.Context, cl client.Client, namespace string, machines ...*clusterv1.Machine)
DeleteMachines deletes the specified machines.
func DeleteObjects ¶
DeleteObjects deletes the objects in the given list, tolerating NotFound errors.
func GetAWSMachine ¶
func GetAWSMachine(name string, namespace string) (*awsv1.AWSMachine, error)
GetAWSMachine gets an AWSMachine by its name.
func GetAWSMachineWithRetry ¶
func GetAWSMachineWithRetry(name string, namespace string) *awsv1.AWSMachine
GetAWSMachineWithRetry gets an AWSMachine by its name, retrying until found or timeout.
func GetFirstMAPIMachineSet ¶
func GetFirstMAPIMachineSet(ctx context.Context, cl client.Client) *mapiv1beta1.MachineSet
GetFirstMAPIMachineSet lists MAPI MachineSets, sorts by name, and returns the first one.
func GetMAPIProviderSpec ¶
GetMAPIProviderSpec lists MAPI MachineSets, sorts by name, and unmarshals the first MachineSet's ProviderSpec into the given type T.
func GetMachine ¶
GetMachine gets a machine by its name.
func GetMachineSet ¶
func GetMachineSet(name string, namespace string) (*clusterv1.MachineSet, error)
GetMachineSet gets a machineset by its name.
func GetMachineSetWithRetry ¶
func GetMachineSetWithRetry(name string, namespace string) *clusterv1.MachineSet
GetMachineSetWithRetry gets a machineset by its name, retrying until found or timeout.
func GetMachineWithRetry ¶
GetMachineWithRetry gets a machine by its name, retrying until found or timeout.
func GetMachines ¶
func GetMachines(selectors ...*metav1.LabelSelector) []*clusterv1.Machine
GetMachines gets a list of machines from the default cluster API namespace. Optionally, labels may be used to constrain listed machines.
func GetMachinesFromMachineSet ¶
func GetMachinesFromMachineSet(machineSet *clusterv1.MachineSet) []*clusterv1.Machine
GetMachinesFromMachineSet returns an array of machines owned by a given machineSet.
func GetNewestMachineFromMachineSet ¶
func GetNewestMachineFromMachineSet(machineSet *clusterv1.MachineSet) *clusterv1.Machine
GetNewestMachineFromMachineSet returns the newest machine created by a given machineSet.
func GetNodeForMachine ¶
func GetNodeForMachine(ctx context.Context, cl client.Client, m *clusterv1.Machine) (*corev1.Node, error)
GetNodeForMachine retrieves the node backing the given Machine.
func IsFeatureGateEnabled ¶
func IsFeatureGateEnabled(ctx context.Context, cl client.Client, name configv1.FeatureGateName) bool
IsFeatureGateEnabled checks if the named feature gate is enabled for the current cluster version.
func NewMachineSetParams ¶
func NewMachineSetParams(msName, clusterName, failureDomain string, replicas int32, infrastructureRef clusterv1.ContractVersionedObjectReference, userDataSecretName string) machineSetParams
NewMachineSetParams returns a new machineSetParams object.
func ScaleCAPIMachineSet ¶
ScaleCAPIMachineSet scales a machineSet with a given name to the given number of replicas.
func SortListByName ¶
func SortListByName(list client.ObjectList)
SortListByName sorts the Items of a Kubernetes list object in place by metadata name.
func WaitForMachineSet ¶
func WaitForMachineSet(ctx context.Context, cl client.Client, name string, namespace string, timeout ...time.Duration)
WaitForMachineSet waits for 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(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.