Documentation ¶
Index ¶
- Constants
- func KubernetesClientFromOptions(t testutil.TestingTB, options *k8s.KubectlOptions) kubernetes.Interface
- func KubernetesContextFromOptions(t testutil.TestingTB, options *k8s.KubectlOptions) string
- func NewContext(namespace, pathToKubeConfig, kubeContextName string) *kubernetesContext
- type KubernetesEnvironment
- type TestContext
- type TestEnvironment
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 (k *KubernetesEnvironment) Context(t testutil.TestingTB, index int) TestContext
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.
Click to show internal directories.
Click to hide internal directories.