Documentation
¶
Overview ¶
Package clusterenv supports controller tests against a real Kubernetes cluster. Cluster and image lifecycle remain external.
Index ¶
Constants ¶
const (
// ContextEnvVar names the kubeconfig context explicitly unlocked for cluster tests.
ContextEnvVar = "DYNAMO_CLUSTERTEST_CONTEXT"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env lazily connects to one externally managed Kubernetes cluster.
type Options ¶
type Options struct {
Scheme *runtime.Scheme
SetupWebhooks func(ctrl.Manager) error
AdditionalAdmission webhookconfig.Configurations
WebhookProxyImage string
EventuallyTimeout time.Duration
NamespaceDeleteTimeout time.Duration
}
Options configures an Env.
type TestEnv ¶
type TestEnv struct {
// contains filtered or unexported fields
}
TestEnv provides a dedicated namespace and a controller manager for one test.
func (*TestEnv) BlockReplicaSets ¶
func (e *TestEnv) BlockReplicaSets()
BlockReplicaSets prevents Deployments from being actuated while allowing Job-backed tests to run Pods in the test namespace.
func (*TestEnv) BlockWorkloads ¶
func (e *TestEnv) BlockWorkloads()
BlockWorkloads prevents controllers from creating ReplicaSets and Pods in the test namespace without changing the workload manifests under test.
func (*TestEnv) Client ¶
Client returns an unrestricted client for the selected cluster. Tests must use Namespace for namespaced fixtures.
func (*TestEnv) RESTConfig ¶
RESTConfig returns a copy of the selected cluster REST configuration.