validation

package
v3.0.0-...-d6c4d9c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 32 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 ValidateApplicationDefinitionWithOpenAPI

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

func ValidateApplicationInstallationSpec

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

ValidateApplicationInstallationSpec validates the ApplicationInstallation Spec.

func ValidateApplicationInstallationUpdate

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

ValidateApplicationInstallationUpdate validates the update event on an ApplicationInstallation.

func ValidateApplicationVersions

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 ValidateClusterSpec

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

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

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

func ValidateContainerRuntime(spec *kubermaticv1.ClusterSpec) error

func ValidateDeployOpts

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

func ValidateKKPManagedApplicationInstallationUpdate

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

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

func ValidateKubermaticConfigurationSpec

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

func ValidateKubermaticVersioningConfiguration

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

func ValidateLeaderElectionSettings

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

func ValidateNewClusterSpec

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

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

func ValidateUpdateWindow

func ValidateUpdateWindow(updateWindow *kubermaticv1.UpdateWindow) error

func ValidateUser

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

func ValidateUserCreate

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

func ValidateUserDelete

func ValidateUserDelete(user *kubermaticv1.User) error

func ValidateUserSSHKey

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

func ValidateUserSSHKeyCreate

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

func ValidateUserSSHKeyUpdate

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

func ValidateUserUpdate

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

func ValidateVersion

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