environment

package
v0.0.0-...-7754ea6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContextIndex = 0
)

Variables

This section is empty.

Functions

func KubernetesClientFromOptions

func KubernetesClientFromOptions(t testutil.TestingTB, options *k8s.KubectlOptions) kubernetes.Interface

KubernetesClientFromOptions takes KubectlOptions and returns Kubernetes API client.

func KubernetesContextFromOptions

func KubernetesContextFromOptions(t testutil.TestingTB, options *k8s.KubectlOptions) string

KubernetesContextFromOptions returns the Kubernetes context from options. If context is explicitly set in options, it returns that context. Otherwise, it returns the current context.

func NewContext

func NewContext(namespace, pathToKubeConfig, kubeContextName string) *kubernetesContext

Types

type KubernetesEnvironment

type KubernetesEnvironment struct {
	// contains filtered or unexported fields
}

func NewKubernetesEnvironmentFromConfig

func NewKubernetesEnvironmentFromConfig(config *config.TestConfig) *KubernetesEnvironment

func (*KubernetesEnvironment) Context

func (*KubernetesEnvironment) DefaultContext

func (k *KubernetesEnvironment) DefaultContext(t testutil.TestingTB) TestContext

type TestContext

type TestContext interface {
	KubectlOptions(t testutil.TestingTB) *k8s.KubectlOptions
	KubectlOptionsForNamespace(ns string) *k8s.KubectlOptions
	KubernetesClient(t testutil.TestingTB) kubernetes.Interface
	ControllerRuntimeClient(t testutil.TestingTB) client.Client
}

TestContext represents a specific context a test needs, for example, information about a specific Kubernetes cluster.

type TestEnvironment

type TestEnvironment interface {
	DefaultContext(t testutil.TestingTB) TestContext
	Context(t testutil.TestingTB, index int) TestContext
}

TestEnvironment represents the infrastructure environment of the test, such as the kubernetes cluster(s) the test is running against.

Jump to

Keyboard shortcuts

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