mutators

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoManagedClusterDefined describes an AzureASOManagedControlPlane without a ManagedCluster.
	ErrNoManagedClusterDefined = fmt.Errorf("no %s ManagedCluster defined in AzureASOManagedControlPlane spec.resources", asocontainerservicev1hub.GroupVersion.Group)

	// ErrNoAzureASOManagedMachinePools means no AzureASOManagedMachinePools exist for an AzureASOManagedControlPlane.
	ErrNoAzureASOManagedMachinePools = errors.New("no AzureASOManagedMachinePools found for AzureASOManagedControlPlane")
)
View Source
var ErrNoManagedClustersAgentPoolDefined = fmt.Errorf("no %s ManagedClustersAgentPools defined in AzureASOManagedMachinePool spec.resources", asocontainerservicev1.GroupVersion.Group)

ErrNoManagedClustersAgentPoolDefined describes an AzureASOManagedMachinePool without a ManagedClustersAgentPool.

Functions

func ApplyMutators

func ApplyMutators(ctx context.Context, resources []runtime.RawExtension, mutators ...ResourcesMutator) ([]*unstructured.Unstructured, error)

ApplyMutators applies the given mutators to the given resources.

func Pause

func Pause(ctx context.Context, resources []*unstructured.Unstructured) error

Pause sets the "skip" reconcile policy on all resources to facilitate a CAPI pause.

func ToUnstructured

func ToUnstructured(ctx context.Context, resources []runtime.RawExtension) ([]*unstructured.Unstructured, error)

ToUnstructured converts the given resources to Unstructured.

Types

type Incompatible

type Incompatible struct {
	// contains filtered or unexported fields
}

Incompatible describes an error where a piece of user-defined configuration does not match what CAPZ requires.

func (Incompatible) Error

func (e Incompatible) Error() string

type ResourcesMutator

type ResourcesMutator func(context.Context, []*unstructured.Unstructured) error

ResourcesMutator mutates in-place a slice of ASO resources to be reconciled. These mutations make only the changes strictly necessary for CAPZ resources to play nice with Cluster API. Any mutations should be logged and mutations that conflict with user-defined values should be rejected by returning Incompatible.

func SetAgentPoolDefaults

func SetAgentPoolDefaults(ctrlClient client.Client, machinePool *expv1.MachinePool) ResourcesMutator

SetAgentPoolDefaults propagates config from a MachinePool to an AzureASOManagedMachinePool's defined ManagedClustersAgentPool.

func SetManagedClusterDefaults

func SetManagedClusterDefaults(ctrlClient client.Client, asoManagedControlPlane *infrav1alpha.AzureASOManagedControlPlane, cluster *clusterv1.Cluster) ResourcesMutator

SetManagedClusterDefaults propagates values defined by Cluster API to an ASO ManagedCluster.

Jump to

Keyboard shortcuts

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