envtest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKubeconfigFileForRestConfig added in v0.4.0

func CreateKubeconfigFileForRestConfig(restConfig *rest.Config) (clientcmdapi.Config, error)

func Run

func Run(m *testing.M, setupFunc func(e *Environment)) (code int)

func RunMulti added in v0.4.0

func RunMulti(m *testing.M, setupFunc func(e *MultiK8sEnvironment), numClusters int) (code int)

func RunMultiKind added in v0.5.0

func RunMultiKind(setupFunc func(e *MultiK8sEnvironment), topology []int, testDir string) (deferFunc func())

Types

type Environment

type Environment struct {
	Context     context.Context
	Kubeconfig  string
	KindCluster KindManager
	// contains filtered or unexported fields
}

func NewEnvironment

func NewEnvironment(ctx context.Context) *Environment

func NewKindEnvironment added in v0.5.0

func NewKindEnvironment(ctx context.Context, cluster KindManager) *Environment

func (*Environment) CreateNamespace

func (e *Environment) CreateNamespace(t *testing.T) string

func (*Environment) GetClientInNamespace added in v0.4.0

func (e *Environment) GetClientInNamespace(namespace string) client.Client

func (*Environment) GetKubeconfig added in v0.4.0

func (e *Environment) GetKubeconfig() ([]byte, error)

func (*Environment) RawClient added in v0.4.0

func (e *Environment) RawClient() client.Client

func (*Environment) RestConfig added in v0.3.0

func (e *Environment) RestConfig() *rest.Config

func (*Environment) Start added in v0.4.0

func (e *Environment) Start()

func (*Environment) Stop added in v0.4.0

func (e *Environment) Stop()

type KindManager added in v0.5.0

type KindManager struct {
	ClusterName        string
	Nodes              int
	KubeconfigLocation *os.File

	RestConfig *rest.Config
	// contains filtered or unexported fields
}

func (*KindManager) CreateKindCluster added in v0.5.0

func (k *KindManager) CreateKindCluster() error

func (*KindManager) GetClient added in v0.5.0

func (k *KindManager) GetClient() (*client.Client, error)

func (*KindManager) TearDownKindCluster added in v0.5.0

func (k *KindManager) TearDownKindCluster() error

type MultiK8sEnvironment added in v0.4.0

type MultiK8sEnvironment []*Environment

Jump to

Keyboard shortcuts

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