Documentation ¶
Index ¶
- Constants
- func CheckDockerAllocatedMemory(ctx context.Context, dockerExecutable DockerExecutable)
- func CheckMinimumDockerVersion(ctx context.Context, dockerExecutable DockerExecutable) error
- func FileExists(filename string) bool
- func FileExistsAndIsNotEmpty(filename string) bool
- func NewKubectl(t *testing.T) (*executables.Kubectl, context.Context, *types.Cluster, ...)
- func ProcessValidationResults(validations []Validation) error
- func ValidateAuthenticationForGitProvider(clusterSpec *cluster.Spec, cliConfig *config.CliConfig) error
- func ValidateAuthenticationForRegistryMirror(clusterSpec *cluster.Spec) error
- func ValidateBottlerocketKubeletConfig(spec *cluster.Spec) error
- func ValidateCertForRegistryMirror(clusterSpec *cluster.Spec, tlsValidator TlsValidator) error
- func ValidateClusterNameArg(args []string) (string, error)
- func ValidateClusterNameFromCommandAndConfig(args []string, clusterNameConfig string) error
- func ValidateDockerExecutable(ctx context.Context, docker DockerExecutable, os string) error
- func ValidateEksaReleaseExistOnManagement(ctx context.Context, k kubernetes.Client, workload *v1alpha1.Cluster) error
- func ValidateEksaVersion(ctx context.Context, cliVersion string, workload *cluster.Spec) error
- func ValidateEksaVersionSkew(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, ...) error
- func ValidateManagementClusterEksaVersion(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, ...) error
- func ValidateManagementClusterName(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, ...) error
- func ValidateManagementComponentsVersionSkew(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, ...) error
- func ValidateManagementEksaVersion(mgmtCluster, cluster *v1alpha1.Cluster) error
- func ValidateOSForRegistryMirror(clusterSpec *cluster.Spec, provider providers.Provider) error
- func ValidatePauseAnnotation(ctx context.Context, k KubectlClient, cluster *types.Cluster, ...) error
- func ValidateSkippableValidation(skippedValidations []string, skippableValidations []string) (map[string]bool, error)
- type DockerExecutable
- type KubectlClient
- type Opts
- type Runner
- type TlsValidator
- type Validation
- type ValidationError
- type ValidationResult
Constants ¶
const ( PDB = "pod-disruption" VSphereUserPriv = "vsphere-user-privilege" EksaVersionSkew = "eksa-version-skew" )
string values of supported validation names that can be skipped.
Variables ¶
This section is empty.
Functions ¶
func CheckDockerAllocatedMemory ¶
func CheckDockerAllocatedMemory(ctx context.Context, dockerExecutable DockerExecutable)
func CheckMinimumDockerVersion ¶
func CheckMinimumDockerVersion(ctx context.Context, dockerExecutable DockerExecutable) error
func FileExists ¶
func FileExistsAndIsNotEmpty ¶ added in v0.8.0
func NewKubectl ¶ added in v0.6.0
func NewKubectl(t *testing.T) (*executables.Kubectl, context.Context, *types.Cluster, *mockexecutables.MockExecutable)
func ProcessValidationResults ¶ added in v0.12.0
func ProcessValidationResults(validations []Validation) error
ProcessValidationResults is currently used for unit test processing.
func ValidateAuthenticationForGitProvider ¶ added in v0.11.0
func ValidateAuthenticationForRegistryMirror ¶ added in v0.12.2
ValidateAuthenticationForRegistryMirror checks if REGISTRY_USERNAME and REGISTRY_PASSWORD is set if authenticated registry mirrors are used.
func ValidateBottlerocketKubeletConfig ¶ added in v0.20.0
ValidateBottlerocketKubeletConfig validates bottlerocket settings for Kubelet Configuration.
func ValidateCertForRegistryMirror ¶ added in v0.8.0
func ValidateCertForRegistryMirror(clusterSpec *cluster.Spec, tlsValidator TlsValidator) error
func ValidateClusterNameArg ¶
func ValidateClusterNameFromCommandAndConfig ¶ added in v0.18.0
ValidateClusterNameFromCommandAndConfig validates if cluster name provided in command matches with cluster name in config file.
func ValidateDockerExecutable ¶ added in v0.12.0
func ValidateDockerExecutable(ctx context.Context, docker DockerExecutable, os string) error
func ValidateEksaReleaseExistOnManagement ¶ added in v0.19.0
func ValidateEksaReleaseExistOnManagement(ctx context.Context, k kubernetes.Client, workload *v1alpha1.Cluster) error
ValidateEksaReleaseExistOnManagement checks if there is a corresponding eksareleases CR for workload's eksaVersion on the mgmt cluster.
func ValidateEksaVersion ¶ added in v0.17.0
ValidateEksaVersion ensures that the version matches EKS-A CLI.
func ValidateEksaVersionSkew ¶ added in v0.17.0
func ValidateEksaVersionSkew(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, spec *cluster.Spec) error
ValidateEksaVersionSkew ensures that upgrades are sequential by CLI minor versions.
func ValidateManagementClusterEksaVersion ¶ added in v0.17.0
func ValidateManagementClusterEksaVersion(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, workload *cluster.Spec) error
ValidateManagementClusterEksaVersion ensures workload cluster isn't created by a newer version than management cluster.
func ValidateManagementClusterName ¶ added in v0.14.0
func ValidateManagementClusterName(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, mgmtClusterName string) error
ValidateManagementClusterName checks if the management cluster specified in the workload cluster spec is valid.
func ValidateManagementComponentsVersionSkew ¶ added in v0.19.1
func ValidateManagementComponentsVersionSkew(ctx context.Context, k KubectlClient, mgmtCluster *types.Cluster, eksaRelease *releasev1alpha1.EKSARelease) error
ValidateManagementComponentsVersionSkew checks if the management components version is only one minor version greater than the cluster version.
func ValidateManagementEksaVersion ¶ added in v0.17.0
ValidateManagementEksaVersion ensures a workload cluster's EksaVersion is not greater than a management cluster's version.
func ValidateOSForRegistryMirror ¶ added in v0.15.0
ValidateOSForRegistryMirror checks if the OS is valid for the provided registry mirror configuration.
func ValidatePauseAnnotation ¶ added in v0.19.0
func ValidatePauseAnnotation(ctx context.Context, k KubectlClient, cluster *types.Cluster, clusterName string) error
ValidatePauseAnnotation checks if the target cluster has annotation anywhere.eks.amazonaws.com/paused set to true or not.
Types ¶
type DockerExecutable ¶
type KubectlClient ¶ added in v0.6.0
type KubectlClient interface { List(ctx context.Context, kubeconfig string, list kubernetes.ObjectList) error 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) GetBundles(ctx context.Context, kubeconfigFile, name, namespace string) (*releasev1alpha1.Bundles, 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) GetEksaTinkerbellDatacenterConfig(ctx context.Context, tinkerbellDatacenterConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.TinkerbellDatacenterConfig, error) GetEksaTinkerbellMachineConfig(ctx context.Context, tinkerbellMachineConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.TinkerbellMachineConfig, error) GetEksaAWSIamConfig(ctx context.Context, awsIamConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.AWSIamConfig, error) SearchIdentityProviderConfig(ctx context.Context, ipName string, kind string, kubeconfigFile string, namespace string) ([]*v1alpha1.VSphereDatacenterConfig, error) GetObject(ctx context.Context, resourceType, name, namespace, kubeconfig string, obj runtime.Object) 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 SkippedValidations map[string]bool CliVersion string KubeClient kubernetes.Client }
func (*Opts) SetDefaults ¶ added in v0.8.0
func (o *Opts) SetDefaults()
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) Register ¶
func (r *Runner) Register(validations ...Validation)
type TlsValidator ¶ added in v0.8.0
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
func (*ValidationError) String ¶ added in v0.12.0
func (v *ValidationError) String() string
type ValidationResult ¶
func (*ValidationResult) LogPass ¶
func (v *ValidationResult) LogPass()
func (*ValidationResult) Report ¶
func (v *ValidationResult) Report()