Documentation
¶
Overview ¶
Package environment adds everything around mgr.Start() to run a local operator for the integration test suites
Index ¶
- func DumpENV(namespace string)
- func GetNamespaceName(namespaceCounter int) string
- func KubeConfig() (*rest.Config, error)
- func NamespaceDeletionInProgress(err error) bool
- func NukeNamespaces(namespacesToNuke []string)
- func SetupNamespace(e *Environment, m machine.Machine, labels map[string]string) error
- type Environment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpENV ¶
func DumpENV(namespace string)
DumpENV executes testing/dump_env.sh to write k8s resources to files
func GetNamespaceName ¶
GetNamespaceName returns a numbered namespace
func KubeConfig ¶
KubeConfig returns a kube config for this environment
func NamespaceDeletionInProgress ¶
NamespaceDeletionInProgress returns true if the error indicates deletion will happen eventually
func NukeNamespaces ¶
func NukeNamespaces(namespacesToNuke []string)
NukeNamespaces uses the kubectl command to remove remaining test namespaces. Used in AfterSuite.
func SetupNamespace ¶
SetupNamespace creates a new labeled namespace and sets the teardown func in the environment
Types ¶
type Environment ¶
type Environment struct { ID int KubeConfig *rest.Config Log *zap.SugaredLogger TeardownFunc machine.TearDownFunc Config *config.Config ObservedLogs *observer.ObservedLogs Namespace string // contains filtered or unexported fields }
Environment starts our operator and handles interaction with the k8s cluster used in the tests
func (*Environment) AllLogMessages ¶
func (e *Environment) AllLogMessages() (msgs []string)
AllLogMessages returns only the message part of existing logs to aid in debugging
func (*Environment) SetupLoggerContext ¶
func (e *Environment) SetupLoggerContext(prefix string) context.Context
SetupLoggerContext sets up the logger and puts it into a new context
func (*Environment) StartManager ¶
func (e *Environment) StartManager(mgr manager.Manager)
StartManager is used to clean up the test environment
func (*Environment) Teardown ¶
func (e *Environment) Teardown(wasFailure bool)
Teardown is used to clean up the test environment