validations

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDockerAllocatedMemory

func CheckDockerAllocatedMemory(ctx context.Context, dockerExecutable DockerExecutable)

func CheckDockerDesktopVersion added in v0.7.0

func CheckDockerDesktopVersion(ctx context.Context, dockerExecutable DockerExecutable) error

func CheckMinimumDockerVersion

func CheckMinimumDockerVersion(ctx context.Context, dockerExecutable DockerExecutable) error

func FileExists

func FileExists(filename string) bool

func FileExistsAndIsNotEmpty added in v0.8.0

func FileExistsAndIsNotEmpty(filename string) bool

func NewKubectl added in v0.6.0

func RunPreflightValidations added in v0.8.0

func RunPreflightValidations(validations []ValidationResult) error

func ValidateCertForRegistryMirror added in v0.8.0

func ValidateCertForRegistryMirror(clusterSpec *cluster.Spec, tlsValidator TlsValidator) error

func ValidateClusterNameArg

func ValidateClusterNameArg(args []string) (string, error)

func ValidateDockerDesktopVersion added in v0.8.0

func ValidateDockerDesktopVersion(ctx context.Context, dockerExecutable DockerExecutable, dockerDesktopVersion string) error

func ValidateK8s123Support added in v0.9.1

func ValidateK8s123Support(clusterSpec *cluster.Spec) error

Types

type DockerExecutable

type DockerExecutable interface {
	Version(ctx context.Context) (int, error)
	AllocatedMemory(ctx context.Context) (uint64, error)
	CgroupVersion(ctx context.Context) (int, error)
}

type KubectlClient added in v0.6.0

type KubectlClient interface {
	ValidateControlPlaneNodes(ctx context.Context, cluster *types.Cluster, clusterName string) error
	ValidateWorkerNodes(ctx context.Context, clusterName string, kubeconfig string) error
	ValidateNodes(ctx context.Context, kubeconfig string) error
	ValidateClustersCRD(ctx context.Context, cluster *types.Cluster) error
	ValidateEKSAClustersCRD(ctx context.Context, cluster *types.Cluster) error
	Version(ctx context.Context, cluster *types.Cluster) (*executables.VersionResponse, error)
	GetClusters(ctx context.Context, cluster *types.Cluster) ([]types.CAPICluster, error)
	GetEksaCluster(ctx context.Context, cluster *types.Cluster, clusterName string) (*v1alpha1.Cluster, error)
	GetEksaGitOpsConfig(ctx context.Context, gitOpsConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.GitOpsConfig, error)
	GetEksaFluxConfig(ctx context.Context, fluxConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.FluxConfig, error)
	GetEksaOIDCConfig(ctx context.Context, oidcConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.OIDCConfig, error)
	GetEksaVSphereDatacenterConfig(ctx context.Context, vsphereDatacenterConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.VSphereDatacenterConfig, error)
	GetEksaAWSIamConfig(ctx context.Context, awsIamConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.AWSIamConfig, error)
	SearchEksaGitOpsConfig(ctx context.Context, gitOpsConfigName string, kubeconfigFile string, namespace string) ([]*v1alpha1.GitOpsConfig, error)
	SearchIdentityProviderConfig(ctx context.Context, ipName string, kind string, kubeconfigFile string, namespace string) ([]*v1alpha1.VSphereDatacenterConfig, error)
}

type Opts added in v0.6.0

type Opts struct {
	Kubectl           KubectlClient
	Spec              *cluster.Spec
	WorkloadCluster   *types.Cluster
	ManagementCluster *types.Cluster
	Provider          providers.Provider
	TlsValidator      TlsValidator
	CliConfig         *config.CliConfig
}

func (*Opts) SetDefaults added in v0.8.0

func (o *Opts) SetDefaults()

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner() *Runner

func (*Runner) Register

func (r *Runner) Register(validations ...Validation)

func (*Runner) Run

func (r *Runner) Run() error

type TlsValidator added in v0.8.0

type TlsValidator interface {
	ValidateCert(host, port, caCertContent string) error
	HasSelfSignedCert(host, port string) (bool, error)
}

type Validation

type Validation func() *ValidationResult

type ValidationError added in v0.6.0

type ValidationError struct {
	Errs []string
}

func (*ValidationError) Error added in v0.6.0

func (v *ValidationError) Error() string

type ValidationResult

type ValidationResult struct {
	Name        string
	Err         error
	Remediation string
	Silent      bool
}

func (*ValidationResult) LogPass

func (v *ValidationResult) LogPass()

func (*ValidationResult) Report

func (v *ValidationResult) Report()

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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