validation

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProviderIsNotReady = errors.New("provider is not yet ready")

ErrProviderIsNotReady signals if the corresponding github.com/K0rdent/kcm/api/v1beta1.ProviderTemplate is not yet ready.

Functions

func ClusterAuthenticationDeletionAllowed added in v1.6.0

func ClusterAuthenticationDeletionAllowed(ctx context.Context, mgmtClient client.Client, clAuth *kcmv1.ClusterAuthentication) error

func ClusterDeployCredential

func ClusterDeployCredential(ctx context.Context, cl client.Client, systemNamespace string, cd *kcmv1.ClusterDeployment, clusterTemplate *kcmv1.ClusterTemplate) error

ClusterDeployCredential validates a github.com/K0rdent/kcm/api/v1beta1.Credential object referred in the given github.com/K0rdent/kcm/api/v1beta1.ClusterDeployment is ready and supported by the given github.com/K0rdent/kcm/api/v1beta1.ClusterTemplate.

func ClusterDeploymentDeletionAllowed

func ClusterDeploymentDeletionAllowed(ctx context.Context, mgmtClient client.Client, cld *kcmv1.ClusterDeployment) error

func ClusterTemplateK8sCompatibility

func ClusterTemplateK8sCompatibility(ctx context.Context, cl client.Client, clusterTemplate *kcmv1.ClusterTemplate, cd *kcmv1.ClusterDeployment) error

ClusterTemplateK8sCompatibility validates the K8s version of the given github.com/K0rdent/kcm/api/v1beta1.ClusterTemplate satisfies the K8s constraints (if any) of the github.com/K0rdent/kcm/api/v1beta1.ServiceTemplate objects referenced by the given github.com/K0rdent/kcm/api/v1beta1.ClusterDeployment.

func ClusterTemplateProviders

func ClusterTemplateProviders(ctx context.Context, mgmtClient client.Client, clusterTemplate *kcmv1.ClusterTemplate, cd *kcmv1.ClusterDeployment) error

ClusterTemplateProviders validates that all required providers are exposed and compatible by the parent object (either github.com/K0rdent/kcm/api/v1beta1.Management or github.com/K0rdent/kcm/api/v1beta1.Region).

func GetIncompatibleContracts

func GetIncompatibleContracts(ctx context.Context, cl client.Client, release *kcmv1.Release, obj ComponentsManager) (string, error)

GetIncompatibleContracts validates if all of the providers specified in the given github.com/K0rdent/kcm/api/v1beta1.Management or github.com/K0rdent/kcm/api/v1beta1.Region have compatible CAPI contract versions. Returns ErrProviderIsNotReady if the corresponding github.com/K0rdent/kcm/api/v1beta1.ProviderTemplate is not yet ready and the validation cannot proceed further.

func ManagementDeletionAllowed

func ManagementDeletionAllowed(ctx context.Context, mgmtClient client.Client) error

func ProvidersInUseFor

func ProvidersInUseFor(ctx context.Context, cl client.Client, pTpl *kcmv1.ProviderTemplate, obj ComponentsManager) (map[string][]string, error)

func RegionClusterReference

func RegionClusterReference(ctx context.Context, mgmtClient client.Client, systemNamespace string, rgn *kcmv1.Region) error

func RegionDeletionAllowed

func RegionDeletionAllowed(ctx context.Context, mgmtClient client.Client, rgn *kcmv1.Region) error

func ServicesHaveValidTemplates

func ServicesHaveValidTemplates(ctx context.Context, cl client.Client, services []kcmv1.Service, ns string) error

ServicesHaveValidTemplates validates the given array of github.com/K0rdent/kcm/api/v1beta1.Service checking if referenced github.com/K0rdent/kcm/api/v1beta1.ServiceTemplate is valid and is ready to be consumed.

func ValidateClusterAuthentication added in v1.6.0

func ValidateClusterAuthentication(ctx context.Context, mgmtClient client.Client, clAuth *kcmv1.ClusterAuthentication) error

func ValidateMCSDelete

func ValidateMCSDelete(ctx context.Context, c client.Client, mcs *kcmv1.MultiClusterService) error

ValidateMCSDelete validates if it is safe to delete provided MCS.

func ValidateMCSDependencyOverall

func ValidateMCSDependencyOverall(ctx context.Context, c client.Client, mcs *kcmv1.MultiClusterService) error

ValidateMCSDependencyOverall calls all of the functions related to MultiClusterService dependency validation one by one.

func ValidateServiceDependencyOverall

func ValidateServiceDependencyOverall(services []kcmv1.Service) error

ValidateServiceDependencyOverall calls all of the functions related to service dependency validation one by one.

Types

type ClusterParent

type ClusterParent interface {
	client.Object

	HelmReleaseName(string) string
	GetComponentsStatus() *kcmv1.ComponentsCommonStatus
}

type ComponentsManager

type ComponentsManager interface {
	client.Object

	Components() kcmv1.ComponentsCommonSpec
}

type InUseProviderParams

type InUseProviderParams struct {
	// Regions maps region names to a boolean indicating whether
	// this provider is in use in that region
	Regions map[string]bool
	// ProviderContracts is the list of supported Cluster API contract versions,
	// e.g. infrastructure-aws: []{v1alpha3, v1alpha4, v1beta1}
	ProviderContracts []string
}

InUseProviderParams describes in which regions this provider is currently in use and which Cluster API contract versions it supports

Jump to

Keyboard shortcuts

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