testutils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MinK8sVersion    string = "v1.25.0"
	TestPodName      string = "plugin-e2e"
	DebugImage       string = "docker.io/library/busybox:1.28"
	EphContainerName string = "debugger"
)

Functions

This section is empty.

Types

type TestResource

type TestResource struct {
	// For invoking kubectl command
	*kbutils.Kubectl
	*kbutils.KubernetesVersion
	// Another namespace besides namespace in context
	AnotherNamespace string
	PluginName       string
}

func NewTestResource

func NewTestResource() (*TestResource, error)

func (*TestResource) CreateNamespace

func (t *TestResource) CreateNamespace(namespace string) error

func (*TestResource) CreateServiceAccount

func (t *TestResource) CreateServiceAccount(namespace string) error

func (*TestResource) CreateTestPod

func (t *TestResource) CreateTestPod(namespace string) error

func (*TestResource) DeleteNamespace

func (t *TestResource) DeleteNamespace(namespace string) error

func (*TestResource) DeleteTestPod

func (t *TestResource) DeleteTestPod(namespace string) error

func (*TestResource) GetTestNamespaces added in v1.3.0

func (t *TestResource) GetTestNamespaces() []string

func (*TestResource) IsKubeAPICompatible

func (t *TestResource) IsKubeAPICompatible() bool

ephemeralcontainer subresource is supported on Kubernetes >= v1.25

func (*TestResource) ListEphemeralContainerNamesForTestPod

func (t *TestResource) ListEphemeralContainerNamesForTestPod(namespace string) (string, error)

func (*TestResource) NewListEmptyMessage added in v1.3.0

func (t *TestResource) NewListEmptyMessage(namespace string) string

func (*TestResource) NewListOutput

func (t *TestResource) NewListOutput(format string, namespace string) string

func (*TestResource) RunDebugContainerForTestPod added in v1.3.0

func (t *TestResource) RunDebugContainerForTestPod(namespace, containerName string, interactive bool) error

Add an ephemeral containers by kubectl debug If interactive, it is not attached

func (*TestResource) RunPluginEditCmd

func (t *TestResource) RunPluginEditCmd(namespace string, podName string) (string, error)

func (*TestResource) RunPluginHelpCmd

func (t *TestResource) RunPluginHelpCmd(subCmd string) (string, error)

func (*TestResource) RunPluginListCmd

func (t *TestResource) RunPluginListCmd(format string, namespace string) (string, error)

func (*TestResource) SetEnv

func (t *TestResource) SetEnv(key, value string)

func (*TestResource) UnsetEnv

func (t *TestResource) UnsetEnv(key string)

func (*TestResource) WaitForTestPodReady added in v1.3.0

func (t *TestResource) WaitForTestPodReady(namespace string) error

Jump to

Keyboard shortcuts

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