util

package
v0.6.0-alpha.24 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLabelToCRD

func AddLabelToCRD(ctx context.Context, crd, label string) error

func AddLabelToPod

func AddLabelToPod(ctx context.Context, podName, namespace, label string) error

func AddLabelToPv

func AddLabelToPv(ctx context.Context, pv, label string) error

func AddLabelToPvc

func AddLabelToPvc(ctx context.Context, pvc, namespace, label string) error

func BuildAddonLabelSelector

func BuildAddonLabelSelector() string

func CRDCountShouldBe

func CRDCountShouldBe(ctx context.Context, name string, count int) error

func CRDShouldExist

func CRDShouldExist(ctx context.Context, name string) error

func CRDShouldNotExist

func CRDShouldNotExist(ctx context.Context, name string) error

func Check added in v0.6.0

func Check(command string, input string) (string, error)

func CheckClusterStatus

func CheckClusterStatus() bool

func CheckKbcliExists

func CheckKbcliExists() error

func CheckPodStatus

func CheckPodStatus() map[string]bool

func CreateFileToPod

func CreateFileToPod(ctx context.Context, namespace, podName, volume, filename, content string) error

func CreateSecretFromFiles

func CreateSecretFromFiles(ctx context.Context, client TestClient, namespace string, name string, files map[string]string) error

func DeleteVeleroDs

func DeleteVeleroDs(ctx context.Context) error

func EnsureClusterExists

func EnsureClusterExists(ctx context.Context) error

func ExecCommand

func ExecCommand(strCommand string) string

func ExecCommandReadline

func ExecCommandReadline(strCommand string) []string

func ExecuteCommand

func ExecuteCommand(command string) bool

func GetAPIVersions

func GetAPIVersions(client *TestClient, name string) ([]string, error)

func GetCRD

func GetCRD(ctx context.Context, name string) ([]string, error)

func GetClusterCreateYaml

func GetClusterCreateYaml(files []string) string

func GetClusterVersion

func GetClusterVersion(folder string) (result []string)

func GetConfig

func GetConfig() (*rest.Config, error)

func GetFiles

func GetFiles(path string) ([]string, error)

func GetFolders

func GetFolders(path string) ([]string, error)

func GetPrefix

func GetPrefix(str string, sub string) (s string)

func GetPvByPvc

func GetPvByPvc(ctx context.Context, namespace, pvc string) ([]string, error)

func GetPvcByPodName

func GetPvcByPodName(ctx context.Context, namespace, podName string) ([]string, error)

func KubectlApplyByFile

func KubectlApplyByFile(ctx context.Context, file string) error

func KubectlConfigUseContext

func KubectlConfigUseContext(ctx context.Context, kubectlContext string) error

func KubectlGetInfo

func KubectlGetInfo(cmdName string, arg []string)

func OpsYaml

func OpsYaml(file string, ops string) bool

func ReadFileFromPodVolume

func ReadFileFromPodVolume(ctx context.Context, namespace, podName, volume, filename string) (string, error)

func ReplaceClusterVersionRef

func ReplaceClusterVersionRef(fileName string, clusterVersionRef string)

func StringStrip

func StringStrip(str string) string

func WaitForCRDEstablished

func WaitForCRDEstablished(crdName string) error

func WaitForPods

func WaitForPods(ctx context.Context, client TestClient, namespace string, pods []string) error

WaitForPods waits till all pods arrive at PodRunning state

func WaitTime

func WaitTime(num int)

Types

type TestClient

type TestClient struct {
	Kubebuilder kbclient.Client
	ClientGo    kubernetes.Interface
	// contains filtered or unexported fields
}

TestClient defines the desired type of Client

func InitTestClient

func InitTestClient(kubecontext string) (TestClient, error)

InitTestClient inits different type clients

func NewTestClient

func NewTestClient(kubecontext string) (TestClient, error)

NewTestClient returns a set of ready-to-use API clients.

Jump to

Keyboard shortcuts

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