validation

package
v2.25.8 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UnsafeCNIUpgradeLabel allows unsafe CNI version upgrade (difference in versions more than one minor version).
	UnsafeCNIUpgradeLabel = "unsafe-cni-upgrade"
	// UnsafeCNIMigrationLabel allows unsafe CNI type migration.
	UnsafeCNIMigrationLabel = "unsafe-cni-migration"
	// UnsafeExposeStrategyMigrationLabel allows unsafe expose strategy migration.
	UnsafeExposeStrategyMigrationLabel = "unsafe-expose-strategy-migration"

	// MaxClusterNameLength is the maximum allowed length for cluster names.
	// This is restricted by the many uses of cluster names, from embedding
	// them in namespace names (and prefixing them) to using them in role
	// names (when using AWS).
	// AWS role names have a max length of 64 characters, "kubernetes-" and
	// "-control-plane" being added by KKP. This leaves 39 usable characters
	// and to give some wiggle room, we define the max length to be 36.
	MaxClusterNameLength = 36

	// EARKeyLength is required key length for encryption at rest.
	EARKeyLength = 32
)

Variables

View Source
var (
	// ErrCloudChangeNotAllowed describes that it is not allowed to change the cloud provider.
	ErrCloudChangeNotAllowed = errors.New("not allowed to change the cloud provider")
)

Functions

func GetCronExpressionParser added in v2.21.0

func GetCronExpressionParser() cron.Parser

func ValidateApplicationDefinitionSpec added in v2.21.0

func ValidateApplicationDefinitionSpec(ad appskubermaticv1.ApplicationDefinition) field.ErrorList

func ValidateApplicationDefinitionUpdate added in v2.21.0

func ValidateApplicationDefinitionUpdate(newAd appskubermaticv1.ApplicationDefinition, oldAd appskubermaticv1.ApplicationDefinition) field.ErrorList

func ValidateApplicationDefinitionWithOpenAPI added in v2.21.0

func ValidateApplicationDefinitionWithOpenAPI(ad appskubermaticv1.ApplicationDefinition, parentFieldPath *field.Path) field.ErrorList

func ValidateApplicationInstallationSpec added in v2.21.0

func ValidateApplicationInstallationSpec(ctx context.Context, client ctrlruntimeclient.Client, ai appskubermaticv1.ApplicationInstallation) field.ErrorList

ValidateApplicationInstallationSpec validates the ApplicationInstallation Spec.

func ValidateApplicationInstallationUpdate added in v2.21.0

func ValidateApplicationInstallationUpdate(ctx context.Context, client ctrlruntimeclient.Client, newAI, oldAI appskubermaticv1.ApplicationInstallation) field.ErrorList

ValidateApplicationInstallationUpdate validates the update event on an ApplicationInstallation.

func ValidateApplicationValues added in v2.25.0

func ValidateApplicationValues(spec appskubermaticv1.ApplicationDefinitionSpec, parentFieldPath *field.Path) []*field.Error

func ValidateApplicationVersions added in v2.21.0

func ValidateApplicationVersions(vs []appskubermaticv1.ApplicationVersion, parentFieldPath *field.Path) []*field.Error

func ValidateCloudChange

func ValidateCloudChange(newSpec, oldSpec kubermaticv1.CloudSpec) error

ValidateCloudChange validates if the cloud provider has been changed.

func ValidateCloudSpec

func ValidateCloudSpec(spec kubermaticv1.CloudSpec, dc *kubermaticv1.Datacenter, ipFamily kubermaticv1.IPFamily, parentFieldPath *field.Path, externalCCM bool) field.ErrorList

ValidateCloudSpec validates if the cloud spec is valid If this is not called from within another validation routine, parentFieldPath can be nil.

func ValidateClusterNetworkConfig added in v2.18.0

func ValidateClusterSpec added in v2.19.0

func ValidateClusterSpec(spec *kubermaticv1.ClusterSpec, dc *kubermaticv1.Datacenter, enabledFeatures features.FeatureGate, versionManager *version.Manager, currentVersion *semver.Semver, parentFieldPath *field.Path) field.ErrorList

ValidateClusterSpec validates the given cluster spec. If this is not called from within another validation routine, parentFieldPath can be nil.

func ValidateClusterTemplate added in v2.21.0

func ValidateClusterTemplate(ctx context.Context, template *kubermaticv1.ClusterTemplate, dc *kubermaticv1.Datacenter, cloudProvider provider.CloudProvider, enabledFeatures features.FeatureGate, versionManager *version.Manager, parentFieldPath *field.Path) field.ErrorList

ValidateClusterTemplate validates a kubermaticv1.ClusterTemplate resource.

func ValidateClusterUpdate added in v2.19.0

func ValidateClusterUpdate(ctx context.Context, newCluster, oldCluster *kubermaticv1.Cluster, dc *kubermaticv1.Datacenter, cloudProvider provider.CloudProvider, versionManager *version.Manager, features features.FeatureGate) field.ErrorList

ValidateClusterUpdate validates the new cluster and if no forbidden changes were attempted.

func ValidateContainerRuntime added in v2.18.0

func ValidateContainerRuntime(spec *kubermaticv1.ClusterSpec) error

func ValidateDeployOpts added in v2.22.0

func ValidateDeployOpts(deployOpts *appskubermaticv1.DeployOptions, f *field.Path) []*field.Error

func ValidateKKPManagedApplicationInstallationUpdate added in v2.22.0

func ValidateKKPManagedApplicationInstallationUpdate(newAI, oldAI appskubermaticv1.ApplicationInstallation) field.ErrorList

ValidateKKPManagedApplicationInstallationUpdate validates the update event on a KKP-managed ApplicationInstallation.

func ValidateKubermaticConfigurationSpec added in v2.21.0

func ValidateKubermaticConfigurationSpec(spec *kubermaticv1.KubermaticConfigurationSpec) field.ErrorList

func ValidateKubermaticVersioningConfiguration added in v2.21.0

func ValidateKubermaticVersioningConfiguration(config kubermaticv1.KubermaticVersioningConfiguration, parentFieldPath *field.Path) field.ErrorList

func ValidateLeaderElectionSettings added in v2.16.4

func ValidateLeaderElectionSettings(l *kubermaticv1.LeaderElectionSettings, fldPath *field.Path) field.ErrorList

func ValidateMeteringConfiguration added in v2.21.0

func ValidateMeteringConfiguration(configuration *kubermaticv1.MeteringConfiguration) error

func ValidateNewClusterSpec added in v2.19.0

func ValidateNewClusterSpec(ctx context.Context, spec *kubermaticv1.ClusterSpec, dc *kubermaticv1.Datacenter, cloudProvider provider.CloudProvider, versionManager *version.Manager, enabledFeatures features.FeatureGate, parentFieldPath *field.Path) field.ErrorList

func ValidateNodePortRange added in v2.17.1

func ValidateNodePortRange(nodePortRange string, fldPath *field.Path) *field.Error

func ValidateUpdateWindow

func ValidateUpdateWindow(updateWindow *kubermaticv1.UpdateWindow) error

func ValidateUser added in v2.21.0

func ValidateUser(u *kubermaticv1.User) field.ErrorList

func ValidateUserCreate added in v2.21.0

func ValidateUserCreate(user *kubermaticv1.User) field.ErrorList

func ValidateUserDelete added in v2.22.0

func ValidateUserDelete(ctx context.Context,
	user *kubermaticv1.User,
	client ctrlruntimeclient.Client,
	seedsGetter provider.SeedsGetter,
	seedClientGetter provider.SeedClientGetter) error

func ValidateUserSSHKey added in v2.21.0

func ValidateUserSSHKey(key *kubermaticv1.UserSSHKey) field.ErrorList

func ValidateUserSSHKeyCreate added in v2.21.0

func ValidateUserSSHKeyCreate(key *kubermaticv1.UserSSHKey) field.ErrorList

func ValidateUserSSHKeyUpdate added in v2.21.0

func ValidateUserSSHKeyUpdate(oldKey, newKey *kubermaticv1.UserSSHKey) field.ErrorList

func ValidateUserUpdate added in v2.21.0

func ValidateUserUpdate(oldUser, newUser *kubermaticv1.User) field.ErrorList

func ValidateVersion added in v2.23.0

func ValidateVersion(spec *kubermaticv1.ClusterSpec, versionManager *version.Manager, currentVersion *semver.Semver, fldPath *field.Path) *field.Error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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