Documentation ¶
Index ¶
- Constants
- func FilterAllProviders() []string
- func GetProviderLabel(provider ProviderType) string
- func GetUnstructured(templateName Template) *unstructured.Unstructured
- func PatchHostedClusterReady(kc *kubeclient.KubeClient, provider ProviderType, clusterName string)
- func ValidateDeploymentVars(v []string)
- type ProviderType
- type ProviderValidator
- type Template
- type ValidationAction
Constants ¶
const ( // Common EnvVarManagedClusterName = "MANAGED_CLUSTER_NAME" EnvVarControlPlaneNumber = "CONTROL_PLANE_NUMBER" EnvVarWorkerNumber = "WORKER_NUMBER" EnvVarNamespace = "NAMESPACE" // EnvVarNoCleanup disables After* cleanup in provider specs to allow for // debugging of test failures. EnvVarNoCleanup = "NO_CLEANUP" // AWS EnvVarAWSAccessKeyID = "AWS_ACCESS_KEY_ID" EnvVarAWSSecretAccessKey = "AWS_SECRET_ACCESS_KEY" EnvVarAWSVPCID = "AWS_VPC_ID" EnvVarAWSSubnetID = "AWS_SUBNET_ID" EnvVarAWSSubnetAvailabilityZone = "AWS_SUBNET_AVAILABILITY_ZONE" EnvVarAWSInstanceType = "AWS_INSTANCE_TYPE" EnvVarAWSSecurityGroupID = "AWS_SG_ID" EnvVarAWSClusterIdentity = "AWS_CLUSTER_IDENTITY" EnvVarPublicIP = "AWS_PUBLIC_IP" // VSphere EnvVarVSphereUser = "VSPHERE_USER" EnvVarVSpherePassword = "VSPHERE_PASSWORD" EnvVarVSphereClusterIdentity = "VSPHERE_CLUSTER_IDENTITY" // Azure EnvVarAzureClientSecret = "AZURE_CLIENT_SECRET" EnvVarAzureClientID = "AZURE_CLIENT_ID" EnvVarAzureTenantID = "AZURE_TENANT_ID" EnvVarAzureSubscription = "AZURE_SUBSCRIPTION" EnvVarAzureClusterIdentity = "AZURE_CLUSTER_IDENTITY" EnvVarAzureRegion = "AZURE_REGION" )
Variables ¶
This section is empty.
Functions ¶
func FilterAllProviders ¶
func FilterAllProviders() []string
func GetProviderLabel ¶
func GetProviderLabel(provider ProviderType) string
func GetUnstructured ¶
func GetUnstructured(templateName Template) *unstructured.Unstructured
GetUnstructured returns an unstructured ManagedCluster object based on the provider and template.
func PatchHostedClusterReady ¶
func PatchHostedClusterReady(kc *kubeclient.KubeClient, provider ProviderType, clusterName string)
PatchHostedClusterReady patches a hosted clusters' infrastructure resource as Ready depending on the given provider. See: https://docs.k0smotron.io/stable/capi-aws/#prepare-the-aws-infra-provider Use Eventually as the resource might not be available immediately following a ManagedCluster creation.
func ValidateDeploymentVars ¶
func ValidateDeploymentVars(v []string)
Types ¶
type ProviderType ¶
type ProviderType string
const ( ProviderCAPI ProviderType = "cluster-api" ProviderAWS ProviderType = "infrastructure-aws" ProviderAzure ProviderType = "infrastructure-azure" ProviderVSphere ProviderType = "infrastructure-vsphere" )
type ProviderValidator ¶
type ProviderValidator struct {
// contains filtered or unexported fields
}
ProviderValidator is a struct that contains the necessary information to validate a provider's resources. Some providers do not support all of the resources that can potentially be validated.
func NewProviderValidator ¶
func NewProviderValidator(template Template, clusterName string, action ValidationAction) *ProviderValidator
func (*ProviderValidator) Validate ¶
func (p *ProviderValidator) Validate(ctx context.Context, kc *kubeclient.KubeClient) error
Validate is a provider-agnostic verification that checks for a specific set of resources and either validates their readiness or their deletion depending on the passed map of resourceValidationFuncs and desired order. It is meant to be used in conjunction with an Eventually block. In some cases it may be necessary to end the Eventually block early if the resource will never reach a ready state, in these instances Ginkgo's Fail should be used to end the spec early.
type Template ¶
type Template string
const ( TemplateAWSStandaloneCP Template = "aws-standalone-cp" TemplateAWSHostedCP Template = "aws-hosted-cp" TemplateAzureHostedCP Template = "azure-hosted-cp" TemplateAzureStandaloneCP Template = "azure-standalone-cp" TemplateVSphereStandaloneCP Template = "vsphere-standalone-cp" TemplateVSphereHostedCP Template = "vsphere-hosted-cp" )
type ValidationAction ¶
type ValidationAction string
const ( ValidationActionDeploy ValidationAction = "deploy" ValidationActionDelete ValidationAction = "delete" )
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package aws contains specific helpers for testing a managed cluster that uses the AWS infrastructure provider.
|
Package aws contains specific helpers for testing a managed cluster that uses the AWS infrastructure provider. |