utils

package
v0.0.0-...-e5c8c29 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ManagementClusterType = ClusterType{Name: "management-cluster"}
View Source
var WorkloadClusterType = ClusterType{Name: "cluster"}

Functions

func CheckKubectlCLIInstallation

func CheckKubectlCLIInstallation()

func CheckRequiredEnvVars

func CheckRequiredEnvVars(provider Provider) error

func CheckTanzuCLIInstallation

func CheckTanzuCLIInstallation() error

func CheckTanzuClusterCLIPluginInstallation

func CheckTanzuClusterCLIPluginInstallation(clusterType ClusterType)

func GetClusterNodes

func GetClusterNodes(kubeConfigPath string, kubeContext string) ([]string, error)

func ManagementClusterCreationFailureTasks

func ManagementClusterCreationFailureTasks(ctx context.Context, r ClusterTestRunner, managementClusterName, kubeConfigPath, managementClusterKubeContext string, provider Provider)

func PlatformSupportCheck

func PlatformSupportCheck()

func RunProviderTest

func RunProviderTest(provider Provider, r ClusterTestRunner, packageDetails tce.Package) error

func UpdateVars

func UpdateVars(provider string, clusterType ClusterType)

TODO: Why pass provider if it's only for vSphere?

func WorkloadClusterCreationFailureTasks

func WorkloadClusterCreationFailureTasks(ctx context.Context, r ClusterTestRunner, managementClusterName, workloadClusterName, kubeConfigPath, managementClusterKubeContext, workloadClusterKubeContext string, provider Provider)

Types

type ClusterTestRunner

type ClusterTestRunner interface {
	RunChecks()
	GetRandomClusterNames() (string, string)
	GetKubeContextForTanzuCluster(clusterName string) string
	GetKubeConfigPath() (string, error)
	RunCluster(clusterName string, provider Provider, clusterType ClusterType) error
	GetClusterKubeConfig(clusterName string, provider Provider, clusterType ClusterType)
	PrintClusterInformation(kubeConfigPath string, kubeContext string) error
	CheckWorkloadClusterIsRunning(workloadClusterName string) error
	DeleteCluster(clusterName string, provider Provider, clusterType ClusterType) error
	WaitForWorkloadClusterDeletion(workloadClusterName string) error
	CollectManagementClusterDiagnostics(managementClusterName string) error
	CollectManagementClusterAndWorkloadClusterDiagnostics(managementClusterName string, workloadClusterName string, workloadClusterInfra string) error
	DeleteContext(kubeConfigPath string, contextName string) error
	CleanupDockerBootstrapCluster(managementClusterName string) error
}

type ClusterType

type ClusterType struct {
	Name string
}

func (ClusterType) TanzuCommand

func (clusterType ClusterType) TanzuCommand() string

type DefaultClusterTestRunner

type DefaultClusterTestRunner struct{}

func (DefaultClusterTestRunner) CheckWorkloadClusterIsRunning

func (r DefaultClusterTestRunner) CheckWorkloadClusterIsRunning(workloadClusterName string) error

func (DefaultClusterTestRunner) CleanupDockerBootstrapCluster

func (r DefaultClusterTestRunner) CleanupDockerBootstrapCluster(managementClusterName string) error

func (DefaultClusterTestRunner) CollectManagementClusterAndWorkloadClusterDiagnostics

func (r DefaultClusterTestRunner) CollectManagementClusterAndWorkloadClusterDiagnostics(managementClusterName string, workloadClusterName string, workloadClusterInfra string) error

func (DefaultClusterTestRunner) CollectManagementClusterDiagnostics

func (r DefaultClusterTestRunner) CollectManagementClusterDiagnostics(managementClusterName string) error

func (DefaultClusterTestRunner) DeleteCluster

func (r DefaultClusterTestRunner) DeleteCluster(clusterName string, provider Provider, clusterType ClusterType) error

func (DefaultClusterTestRunner) DeleteContext

func (r DefaultClusterTestRunner) DeleteContext(kubeConfigPath string, contextName string) error

func (DefaultClusterTestRunner) GetClusterKubeConfig

func (r DefaultClusterTestRunner) GetClusterKubeConfig(clusterName string, provider Provider, clusterType ClusterType)

func (DefaultClusterTestRunner) GetKubeConfigPath

func (r DefaultClusterTestRunner) GetKubeConfigPath() (string, error)

func (DefaultClusterTestRunner) GetKubeContextForTanzuCluster

func (r DefaultClusterTestRunner) GetKubeContextForTanzuCluster(clusterName string) string

func (DefaultClusterTestRunner) GetRandomClusterNames

func (r DefaultClusterTestRunner) GetRandomClusterNames() (string, string)

func (DefaultClusterTestRunner) PrintClusterInformation

func (r DefaultClusterTestRunner) PrintClusterInformation(kubeConfigPath string, kubeContext string) error

func (DefaultClusterTestRunner) RunChecks

func (r DefaultClusterTestRunner) RunChecks()

func (DefaultClusterTestRunner) RunCluster

func (r DefaultClusterTestRunner) RunCluster(clusterName string, provider Provider, clusterType ClusterType) error

func (DefaultClusterTestRunner) WaitForWorkloadClusterDeletion

func (r DefaultClusterTestRunner) WaitForWorkloadClusterDeletion(workloadClusterName string) error

type Provider

type Provider interface {
	Name() string
	Init() error
	RequiredEnvVars() []string
	PreClusterCreationTasks(clusterName string, clusterType ClusterType) error
	CleanupCluster(ctx context.Context, clusterName string) error
	GetTanzuConfig(clusterName string) tanzu.TanzuConfig
}

TODO: Change name?

type WorkloadCluster

type WorkloadCluster struct {
	Name   string `json:"name"`
	Status string `json:"status"`
}

type WorkloadClusters

type WorkloadClusters []WorkloadCluster

Directories

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

Jump to

Keyboard shortcuts

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