Documentation ¶
Overview ¶
Package framework implements the test framework.
Index ¶
- Constants
- func AddDefaultSchemes(scheme *runtime.Scheme)
- func GetTempClusterConfigFile(clusterConfigFile string, options *CreateClusterOptions) (string, error)
- func WaitForNodes(proxy *ClusterProxy, desiredCount int)
- type ClusterProxy
- func (p *ClusterProxy) GetClient() client.Client
- func (p *ClusterProxy) GetClientSet() *kubernetes.Clientset
- func (p *ClusterProxy) GetClusterNodes() []corev1.Node
- func (p *ClusterProxy) GetKubernetesVersion() string
- func (p *ClusterProxy) GetProviderVersions(ctx context.Context) map[string]string
- func (p *ClusterProxy) GetRestConfig() *rest.Config
- func (p *ClusterProxy) GetScheme() *runtime.Scheme
- type CreateClusterOptions
- type E2EConfig
- type E2EConfigInput
- type ManagementClusterOptions
Constants ¶
const ( // TkgDefaultClusterPrefix is TKG cluster prefix TkgDefaultClusterPrefix = "tkg-cli-" // TkgDefaultTimeout is the default timeout TkgDefaultTimeout = "30m" // TkgDefaultLogLevel is the default log level TkgDefaultLogLevel = 6 )
Variables ¶
This section is empty.
Functions ¶
func AddDefaultSchemes ¶
AddDefaultSchemes adds the default schemes
func GetTempClusterConfigFile ¶
func GetTempClusterConfigFile(clusterConfigFile string, options *CreateClusterOptions) (string, error)
GetTempClusterConfigFile gets temporary config file
func WaitForNodes ¶
func WaitForNodes(proxy *ClusterProxy, desiredCount int)
WaitForNodes waits for desiredCount number of nodes to be ready
Types ¶
type ClusterProxy ¶
type ClusterProxy struct {
// contains filtered or unexported fields
}
ClusterProxy hold information to connect to a cluster
func NewClusterProxy ¶
func NewClusterProxy(name, kubeconfigPath, contextName string) *ClusterProxy
NewClusterProxy returns clusterProxy
func (*ClusterProxy) GetClient ¶
func (p *ClusterProxy) GetClient() client.Client
GetClient gets the Client of a cluster
func (*ClusterProxy) GetClientSet ¶
func (p *ClusterProxy) GetClientSet() *kubernetes.Clientset
GetClientSet gets the ClientSet of a cluster
func (*ClusterProxy) GetClusterNodes ¶
func (p *ClusterProxy) GetClusterNodes() []corev1.Node
GetClusterNodes gets the cluster Nodes
func (*ClusterProxy) GetKubernetesVersion ¶
func (p *ClusterProxy) GetKubernetesVersion() string
GetKubernetesVersion gets the k8s version
func (*ClusterProxy) GetProviderVersions ¶
func (p *ClusterProxy) GetProviderVersions(ctx context.Context) map[string]string
GetProviderVersions gets the TKG provider versions
func (*ClusterProxy) GetRestConfig ¶
func (p *ClusterProxy) GetRestConfig() *rest.Config
GetRestConfig returns the RestConfig of a cluster
func (*ClusterProxy) GetScheme ¶
func (p *ClusterProxy) GetScheme() *runtime.Scheme
GetScheme returns scheme
type CreateClusterOptions ¶
type CreateClusterOptions struct { GenerateOnly bool SkipPrompt bool ControlPlaneMachineCount int WorkerMachineCount int ClusterName string Plan string InfrastructureProvider string Namespace string KubernetesVersion string Size string ControlPlaneSize string WorkerSize string CniType string EnableClusterOptions string VsphereControlPlaneEndpoint string Timeout time.Duration OtherConfigs map[string]string }
CreateClusterOptions represent options to create a TKG cluster
type E2EConfig ¶
type E2EConfig struct { UseExistingCluster bool `json:"use_existing_cluster,omitempty"` UpgradeManagementCluster bool `json:"upgrade_management_cluster,omitempty"` TkgCliLogLevel int32 `json:"tkg_cli_log_level,omitempty"` InfrastructureName string `json:"infrastructure_name,omitempty"` InfrastructureVersion string `json:"infrastructure_version,omitempty"` ClusterAPIVersion string `json:"capi_version,omitempty"` TkrVersion string `json:"kubernetes_version,omitempty"` TkgCliPath string `json:"tkg_cli_path,omitempty"` InfrastructureVersionOld string `json:"infrastructure_version_old,omitempty"` ClusterAPIVersionOld string `json:"capi_version_old,omitempty"` KubernetesVersionOld string `json:"kubernetes_version_old,omitempty"` TkgCliPathOld string `json:"tkg_cli_path_old,omitempty"` DefaultTimeout string `json:"default_timeout,omitempty"` TkgConfigDir string `json:"tkg_config_dir,omitempty"` TkgClusterConfigPath string `json:"tkg_config_path,omitempty"` ManagementClusterName string `json:"management_cluster_name,omitempty"` ClusterPrefix string `json:"cluster_prefix,omitempty"` TkgConfigVariables map[string]string `json:"tkg_config_variables,omitempty"` ManagementClusterOptions ManagementClusterOptions `json:"management_cluster_options,omitempty"` }
E2EConfig represents the configuration for the e2e tests
func LoadE2EConfig ¶
func LoadE2EConfig(ctx context.Context, input E2EConfigInput) *E2EConfig
LoadE2EConfig loads the configuration for the e2e test environment
func (*E2EConfig) Defaults ¶
func (c *E2EConfig) Defaults()
Defaults assign default values to the config if not present
func (*E2EConfig) SaveTkgConfigVariables ¶
SaveTkgConfigVariables saves the config variables from e2e config to the TKG config file
type E2EConfigInput ¶
type E2EConfigInput struct {
ConfigPath string
}
E2EConfigInput is the input to E2E test suite
type ManagementClusterOptions ¶
type ManagementClusterOptions struct { Endpoint string `yaml:"endpoint,omitempty"` Plan string `yaml:"plan,omitempty"` Size string `yaml:"size,omitempty"` DeployTKGonVsphere7 bool `yaml:"deploy_tkg_on_vSphere7,omitempty"` EnableTKGSOnVsphere7 bool `yaml:"enable_tkgs_on_vSphere7,omitempty"` }
ManagementClusterOptions represents all options to create a management cluster