validation

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTimeOffset = 5 * 300

Variables

This section is empty.

Functions

func ValidatClusterSpec

func ValidatClusterSpec(spec *platform.ClusterSpec, fldPath *field.Path, validateMachine bool) field.ErrorList

ValidateCluster validates a given ClusterSpec.

func ValidateClusteType

func ValidateClusteType(clusterType string, fldPath *field.Path) field.ErrorList

ValidateClusteType validates a given type.

func ValidateCluster

func ValidateCluster(cluster *types.Cluster) field.ErrorList

ValidateCluster validates a given Cluster.

func ValidateClusterByProvider

func ValidateClusterByProvider(cluster *types.Cluster) field.ErrorList

ValidateClusterByProvider validates a given cluster by cluster provider.

func ValidateClusterCredential added in v1.3.1

func ValidateClusterCredential(ctx context.Context, credential *platform.ClusterCredential, platformClient platforminternalclient.PlatformInterface) field.ErrorList

ValidateClusterCredential validates a given ClusterCredential.

func ValidateClusterFeature

func ValidateClusterFeature(feature *platform.ClusterFeature, fldPath *field.Path) field.ErrorList

ValidateClusterFeature validates a given ClusterFeature.

func ValidateClusterMachines

func ValidateClusterMachines(machines []platform.ClusterMachine, fldPath *field.Path) field.ErrorList

ValidateClusterMachines validates a given CluterMachines.

func ValidateClusterName

func ValidateClusterName(ctx context.Context, clusterName string, fldPath *field.Path, cluster *platform.Cluster, platformClient platforminternalclient.PlatformInterface) field.ErrorList

ValidateClusterName validates a given clusterName and return cluster if exists.

func ValidateClusterScale added in v1.6.0

func ValidateClusterScale(cluster *platform.Cluster, oldCluster *platform.Cluster, fldPath *field.Path) field.ErrorList

ValidateClusterScale tests if master scale up/down to a cluster is valid.

func ValidateClusterUpdate

func ValidateClusterUpdate(cluster *types.Cluster, oldCluster *types.Cluster) field.ErrorList

ValidateClusterUpdate tests if an update to a cluster is valid.

func ValidateFiles

func ValidateFiles(files []platform.File, fldPath *field.Path) field.ErrorList

ValidateFiles validates a given Files.

func ValidateGPUType

func ValidateGPUType(gpuType *platform.GPUType, fldPath *field.Path) field.ErrorList

ValidateGPUType validates a given GPUType.

func ValidateHA

func ValidateHA(ha *platform.HA, fldPath *field.Path) field.ErrorList

ValidateHA validates a given HA.

func ValidateHooks

func ValidateHooks(hooks map[platform.HookType]string, fldPath *field.Path, files []platform.File, filesFldPath *field.Path) field.ErrorList

ValidateHooks validates a given Hooks.

func ValidateMachine

func ValidateMachine(ctx context.Context, machine *platform.Machine, platformClient platforminternalclient.PlatformInterface) field.ErrorList

ValidateMachine validates a given machine.

func ValidateMachineByProvider

func ValidateMachineByProvider(machine *platform.Machine) field.ErrorList

ValidateMachineByProvider validates a given machine by machine provider.

func ValidateMachineSpec

func ValidateMachineSpec(ctx context.Context, spec *platform.MachineSpec, fldPath *field.Path, platformClient platforminternalclient.PlatformInterface) field.ErrorList

ValidateMachineSpec validates a given machine spec.

func ValidateMachineSpecType

func ValidateMachineSpecType(machineType string, fldPath *field.Path) field.ErrorList

ValidateMachineSpecType validates a given type and call provider.Validate.

func ValidateMachineUpdate

func ValidateMachineUpdate(ctx context.Context, machine *platform.Machine, oldMachine *platform.Machine) field.ErrorList

ValidateMachineUpdate tests if an update to a machine is valid.

func ValidateMachineWithCluster

func ValidateMachineWithCluster(ctx context.Context, ip string, fldPath *field.Path, cluster *platform.Cluster, platformClient platforminternalclient.PlatformInterface) field.ErrorList

ValidateMachineWithCluster validates a given machine by ip with cluster.

func ValidateMasterTimeOffset

func ValidateMasterTimeOffset(fldPath *field.Path, masters []*ssh.SSH) field.ErrorList

ValidateMasterTimeOffset validates a given master time offset.

func ValidateSSH

func ValidateSSH(fldPath *field.Path, ip string, port int, user string, password []byte, privateKey []byte, passPhrase []byte) field.ErrorList

ValidateSSH validates a given ssh config.

func ValidateUpdateClusterCredential added in v1.3.1

func ValidateUpdateClusterCredential(ctx context.Context, newObj *platform.ClusterCredential, oldObj *platform.ClusterCredential, platformClient platforminternalclient.PlatformInterface) field.ErrorList

ValidateUpdateClusterCredential tests if an update to a ClusterCredential is valid.

func ValidateWorkerTimeOffset

func ValidateWorkerTimeOffset(fldPath *field.Path, worker *ssh.SSH, masters []*ssh.SSH) field.ErrorList

ValidateWorkerTimeOffset validates a given worker time offset with masters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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