check

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package check implements checks for managed topology.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterClassReferencesAreValid

func ClusterClassReferencesAreValid(clusterClass *clusterv1.ClusterClass) field.ErrorList

ClusterClassReferencesAreValid checks that each template reference in the ClusterClass is valid .

func ClusterClassesAreCompatible

func ClusterClassesAreCompatible(current, desired *clusterv1.ClusterClass) field.ErrorList

ClusterClassesAreCompatible checks the compatibility between new and old versions of a Cluster Class. It checks that: 1) InfrastructureCluster Templates are compatible. 2) ControlPlane Templates are compatible. 3) ControlPlane InfrastructureMachineTemplates are compatible. 4) MachineDeploymentClasses are compatible. 5) MachinePoolClasses are compatible.

func IsMachineDeploymentUpgrading added in v1.6.4

func IsMachineDeploymentUpgrading(ctx context.Context, c client.Reader, md *clusterv1.MachineDeployment) (bool, error)

IsMachineDeploymentUpgrading determines if the MachineDeployment is upgrading. A machine deployment is considered upgrading if at least one of the Machines of this MachineDeployment has a different version.

func IsMachinePoolUpgrading added in v1.6.4

func IsMachinePoolUpgrading(ctx context.Context, c client.Reader, mp *expv1.MachinePool) (bool, error)

IsMachinePoolUpgrading determines if the MachinePool is upgrading. A machine pool is considered upgrading if at least one of the Machines of this MachinePool has a different version.

func LocalObjectTemplateIsValid

func LocalObjectTemplateIsValid(template *clusterv1.LocalObjectTemplate, namespace string, pathPrefix *field.Path) field.ErrorList

LocalObjectTemplateIsValid ensures the template is in the correct namespace, has no nil references, and has a valid Kind and GroupVersion.

func LocalObjectTemplatesAreCompatible

func LocalObjectTemplatesAreCompatible(current, desired clusterv1.LocalObjectTemplate, pathPrefix *field.Path) field.ErrorList

LocalObjectTemplatesAreCompatible checks if two referenced objects are compatible, meaning that they are of the same GroupKind and in the same namespace.

func LocalObjectTemplatesAreInSameNamespace

func LocalObjectTemplatesAreInSameNamespace(current, desired clusterv1.LocalObjectTemplate, pathPrefix *field.Path) field.ErrorList

LocalObjectTemplatesAreInSameNamespace checks if two referenced objects are in the same namespace.

func MachineDeploymentClassesAreCompatible

func MachineDeploymentClassesAreCompatible(current, desired *clusterv1.ClusterClass) field.ErrorList

MachineDeploymentClassesAreCompatible checks if each MachineDeploymentClass in the new ClusterClass is a compatible change from the previous ClusterClass. It checks if the MachineDeploymentClass.Template.Infrastructure reference has changed its Group or Kind.

func MachineDeploymentClassesAreUnique

func MachineDeploymentClassesAreUnique(clusterClass *clusterv1.ClusterClass) field.ErrorList

MachineDeploymentClassesAreUnique checks that no two MachineDeploymentClasses in a ClusterClass share a name.

func MachineDeploymentTopologiesAreValidAndDefinedInClusterClass added in v1.1.0

func MachineDeploymentTopologiesAreValidAndDefinedInClusterClass(desired *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) field.ErrorList

MachineDeploymentTopologiesAreValidAndDefinedInClusterClass checks that each MachineDeploymentTopology name is not empty and unique, and each class in use is defined in ClusterClass.spec.Workers.MachineDeployments.

func MachinePoolClassesAreCompatible added in v1.6.0

func MachinePoolClassesAreCompatible(current, desired *clusterv1.ClusterClass) field.ErrorList

MachinePoolClassesAreCompatible checks if each MachinePoolClass in the new ClusterClass is a compatible change from the previous ClusterClass. It checks if the MachinePoolClass.Template.Infrastructure reference has changed its Group or Kind.

func MachinePoolClassesAreUnique added in v1.6.0

func MachinePoolClassesAreUnique(clusterClass *clusterv1.ClusterClass) field.ErrorList

MachinePoolClassesAreUnique checks that no two MachinePoolClasses in a ClusterClass share a name.

func MachinePoolTopologiesAreValidAndDefinedInClusterClass added in v1.6.0

func MachinePoolTopologiesAreValidAndDefinedInClusterClass(desired *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) field.ErrorList

MachinePoolTopologiesAreValidAndDefinedInClusterClass checks that each MachinePoolTopology name is not empty and unique, and each class in use is defined in ClusterClass.spec.Workers.MachinePools.

func ObjectsAreCompatible

func ObjectsAreCompatible(current, desired client.Object) field.ErrorList

ObjectsAreCompatible checks if two referenced objects are compatible, meaning that they are of the same GroupKind and in the same namespace.

func ObjectsAreInTheSameNamespace

func ObjectsAreInTheSameNamespace(current, desired client.Object) field.ErrorList

ObjectsAreInTheSameNamespace checks if two referenced objects are in the same namespace.

func ObjectsAreStrictlyCompatible

func ObjectsAreStrictlyCompatible(current, desired client.Object) field.ErrorList

ObjectsAreStrictlyCompatible checks if two referenced objects are strictly compatible, meaning that they are compatible and the name of the objects do not change.

Types

This section is empty.

Jump to

Keyboard shortcuts

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