Documentation
¶
Index ¶
- Constants
- func CloneMachinePool(mp *hivev1.MachinePool, modifyFn func(*hivev1.MachinePool) error) (*hivev1.MachinePool, error)
- func GetInfraMachinePool(ctx context.Context, hiveClient client.Client, clusterID string) (*hivev1.MachinePool, error)
- func RunMachinePoolDance(ctx context.Context, clients DanceClients, ...) error
- type DanceClients
Constants ¶
const ( InfraNodeLabel = "node-role.kubernetes.io/infra" TemporaryInfraNodeLabel = "osdctl.openshift.io/infra-resize-temporary-machinepool" )
Variables ¶
This section is empty.
Functions ¶
func CloneMachinePool ¶
func CloneMachinePool(mp *hivev1.MachinePool, modifyFn func(*hivev1.MachinePool) error) (*hivev1.MachinePool, error)
CloneMachinePool deep copies a MachinePool, resets metadata fields so it can be created as a new resource, and applies the modifier function.
func GetInfraMachinePool ¶
func GetInfraMachinePool(ctx context.Context, hiveClient client.Client, clusterID string) (*hivev1.MachinePool, error)
GetInfraMachinePool finds the infra MachinePool in Hive for the given cluster ID.
func RunMachinePoolDance ¶
func RunMachinePoolDance(ctx context.Context, clients DanceClients, originalMp, newMp *hivev1.MachinePool, onTimeout func(ctx context.Context, nodes *corev1.NodeList) error) error
RunMachinePoolDance performs the machinepool dance to replace infra nodes. It takes the original MachinePool and an already-modified new MachinePool. The dance creates a temporary pool, waits for nodes, deletes the original, creates a permanent replacement, then removes the temporary pool.
The onTimeout callback is called when nodes fail to drain within the timeout. It receives the list of stuck nodes and should terminate the backing instances. If onTimeout is nil, the dance will return an error on timeout.