infra

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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.

Types

type DanceClients

type DanceClients struct {
	ClusterClient client.Client
	HiveClient    client.Client
	HiveAdmin     client.Client
}

DanceClients holds the k8s clients needed for the machinepool dance.

Jump to

Keyboard shortcuts

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