validation

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnywhereValidateItemTunnelConnectivity     = "TunnelConnectivity"
	AnywhereValidateItemSSH                    = "SSH"
	AnywhereValidateItemTimeDiff               = "TimeDiff"
	AnywhereValidateItemOSVersion              = "OS"
	AnywhereValidateItemMachineResourceDiskLib = "MachineResourceDiskLib"
	AnywhereValidateItemMachineResourceDiskLog = "MachineResourceDiskLog"
	AnywhereValidateItemMachineResourceCPU     = "MachineResourceCPU"
	AnywhereValidateItemMachineResourceMemory  = "MachineResourceMemory"
	AnywhereValidateItemDefaultRoute           = "DefaultRoute"
	AnywhereValidateItemReservePorts           = "ReservePorts"
	AnywhereValidateItemHostNetOverlapping     = "HostNetOverlapping"
	AnywhereValidateItemFirewall               = "Firewall"
	AnywhereValidateItemSelinux                = "Selinux"
	AnywhereValidateItemStorage                = "Storage"
	// validate all items
	AnywhereValidateItemAll = "All"
)
View Source
const (
	MachineResourceRequstDiskPath     = "/var/lib"
	MachineResourceRequstLogDiskPath  = "/var/log"
	MachineResourceRequstDiskSpace    = 100 // GiB
	MachineResourceRequstLogDiskSpace = 10  // GiB
	MachineResourceRequstCPU          = 4
	MachineResourceRequstMemory       = 8 // GiB
)
View Source
const MaxTimeOffset = 5

Variables

This section is empty.

Functions

func RegisterSupportedOSList added in v1.9.1

func RegisterSupportedOSList(list []string)

func ValidatClusterSpec

func ValidatClusterSpec(platformClient platformv1client.PlatformV1Interface, clusterName string, cls *platform.Cluster, fldPath *field.Path, phase platform.ClusterPhase, validateMachine bool) field.ErrorList

ValidatClusterSpec validates a given ClusterSpec.

func ValidateCIDRs

func ValidateCIDRs(cls *platform.Cluster, specPath *field.Path) field.ErrorList

ValidateCIDRs validates clusterCIDR and serviceCIDR.

func ValidateCSIOperator added in v1.3.1

func ValidateCSIOperator(csioperator *platform.CSIOperatorFeature, fldPath *field.Path) field.ErrorList

func ValidateCephFS added in v1.9.1

func ValidateCephFS(cls *platform.Cluster, fld *field.Path) field.ErrorList

func ValidateCluster

func ValidateCluster(platformClient platformv1client.PlatformV1Interface, obj *types.Cluster) field.ErrorList

ValidateCluster validates a given Cluster.

func ValidateClusterFeature added in v1.3.1

func ValidateClusterFeature(spec *platform.ClusterSpec, fldPath *field.Path) field.ErrorList

func ValidateClusterGPUMachines added in v1.9.0

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

ValidateClusterGPUMachines validates a given GPUMachines.

func ValidateClusterMachines

func ValidateClusterMachines(cls *platform.Cluster, fldPath *field.Path) field.ErrorList

ValidateClusterMachines validates a given CluterMachines.

func ValidateClusterProperty

func ValidateClusterProperty(spec *platform.ClusterSpec, propPath *field.Path) field.ErrorList

ValidateClusterProperty validates a given ClusterProperty.

func ValidateClusterScale added in v1.9.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 ValidateClusterSpecVersion

func ValidateClusterSpecVersion(platformClient platformv1client.PlatformV1Interface, clsName, version string, fldPath *field.Path, phase platform.ClusterPhase) field.ErrorList

ValidateClusterSpecVersion validates a given version.

func ValidateClusterUpdate added in v1.9.0

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

ValidateCluster validates a given Cluster.

func ValidateDefaultRoute added in v1.9.1

func ValidateDefaultRoute(fldPath *field.Path, sshs []*ssh.SSH, expectedNetInterface string) field.ErrorList

func ValidateFirewall added in v1.9.1

func ValidateFirewall(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateIPVS added in v1.6.0

func ValidateIPVS(spec *platform.ClusterSpec, ipvs *bool, fldPath *field.Path) field.ErrorList

func ValidateMachine

func ValidateMachine(machine *platform.Machine, cluster *platformv1.Cluster, platformClient platformv1client.PlatformV1Interface) field.ErrorList

ValidateMachine validates a given machine.

func ValidateMachineResourceCPU added in v1.9.1

func ValidateMachineResourceCPU(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateMachineResourceDiskLib added in v1.9.1

func ValidateMachineResourceDiskLib(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateMachineResourceDiskLog added in v1.9.1

func ValidateMachineResourceDiskLog(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateMachineResourceMemory added in v1.9.1

func ValidateMachineResourceMemory(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateMachineSpec

func ValidateMachineSpec(spec *platform.MachineSpec, cluster *platformv1.Cluster, fldPath *field.Path, platformClient platformv1client.PlatformV1Interface) field.ErrorList

ValidateMachineSpec validates a given machine spec.

func ValidateMachineWithCluster added in v1.9.0

func ValidateMachineWithCluster(ctx context.Context, ip string, fldPath *field.Path, cluster *platformv1.Cluster, platformClient platformv1client.PlatformV1Interface) field.ErrorList

ValidateMachineWithCluster validates a given machine by ip with cluster.

func ValidateMasterTimeOffset added in v1.9.0

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

ValidateMasterTimeOffset validates a given master time offset.

func ValidateNFS added in v1.9.1

func ValidateNFS(cls *platform.Cluster, fld *field.Path) field.ErrorList

func ValidateOSVersion added in v1.9.1

func ValidateOSVersion(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateProxy added in v1.9.1

func ValidateProxy(fldPath *field.Path, proxy ssh.Proxy) field.ErrorList

func ValidateReservePorts added in v1.9.1

func ValidateReservePorts(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateSSH added in v1.9.0

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

ValidateSSH validates a given ssh config.

func ValidateSelinux added in v1.9.1

func ValidateSelinux(fldPath *field.Path, sshs []*ssh.SSH) field.ErrorList

func ValidateStorage added in v1.9.1

func ValidateStorage(cls *platform.Cluster, fld *field.Path) field.ErrorList

func ValidateWorkerTimeOffset added in v1.9.0

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

ValidateWorkerTimeOffset validates a given worker time offset with masters.

Types

type CephCsiCephfs added in v1.9.1

type CephCsiCephfs struct {
	CsiConfig    []CsiConfig   `json:"csiConfig"`
	StorageClass StorageClass  `json:"storageClass"`
	Secret       CephCsiSecret `json:"secret"`
}

type CephCsiSecret added in v1.9.1

type CephCsiSecret struct {
	AdminID  string `json:"adminID"`
	AdminKey string `json:"adminKey"`
}

type CsiConfig added in v1.9.1

type CsiConfig struct {
	ClusterID string   `json:"clusterID"`
	Monitors  []string `json:"monitors"`
}

type Nfs added in v1.9.1

type Nfs struct {
	Server string `json:"server"`
	Path   string `json:"path"`
}

type NfsSubdirExternalProvisioner added in v1.9.1

type NfsSubdirExternalProvisioner struct {
	Nfs Nfs `json:"nfs"`
}

type StorageClass added in v1.9.1

type StorageClass struct {
	ClusterID string `json:"clusterID"`
	FsName    string `json:"fsName"`
}

type StorageGlobalCfg added in v1.9.1

type StorageGlobalCfg struct {
	EnableNFS    bool `json:"enableNFS"`
	EnableCephFS bool `json:"enableCephFS"`
}

type StorageInfo added in v1.9.1

type StorageInfo struct {
	EnableNFS    bool
	EnableCephfs bool
	Nfs          Nfs
	CsiConfig    CsiConfig
}

func GetStorageInfo added in v1.9.1

func GetStorageInfo(annoData []byte) (*StorageInfo, error)

type StorageOverrideValue added in v1.9.1

type StorageOverrideValue struct {
	Global                       StorageGlobalCfg             `json:"global"`
	NfsSubdirExternalProvisioner NfsSubdirExternalProvisioner `json:"nfs-subdir-external-provisioner"`
	CephCsiCephfs                CephCsiCephfs                `json:"ceph-csi-cephfs"`
}

StorageOverrideValue contains all the storage info used to validate from localization OverrideConfig

type TKEValidateResult added in v1.9.1

type TKEValidateResult struct {
	Name        string          `json:"Name"`
	Description string          `json:"Description"`
	Checked     bool            `json:"Checked"`
	Passed      bool            `json:"Passed"`
	ErrorList   field.ErrorList `json:"-"`
	Detail      string          `json:"Detail"`
}

func (TKEValidateResult) ToFieldError added in v1.9.1

func (r TKEValidateResult) ToFieldError() *field.Error

Jump to

Keyboard shortcuts

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