Documentation
¶
Index ¶
- Constants
- Variables
- func IsCleanUpNeeded() bool
- type Clients
- type ClusterTransport
- type Config
- type ControllerConfig
- type Framework
- func (f *Framework) After()
- func (f *Framework) Before()
- func (f *Framework) Create(ctx context.Context, objs ...client.Object) error
- func (f *Framework) DeferDelete(objs ...client.Object)
- func (f *Framework) DeferDeleteFunc(fn func() error)
- func (f *Framework) EnsureCreate(ctx context.Context, obj client.Object) error
- func (f *Framework) EnsureDynamic(ctx context.Context, gvr schema.GroupVersionResource, namespace string, ...) error
- func (f *Framework) EnsureDynamicWithoutCleanup(ctx context.Context, gvr schema.GroupVersionResource, namespace string, ...) error
- func (f *Framework) Namespace() *corev1.Namespace
- func (f *Framework) NamespaceName() string
- type LogFilters
Constants ¶
const ( NamespacePrefix = "e2e" E2ELabel = "e2e-test" )
const PostCleanUpEnv = "E2E_POST_CLEANUP"
Variables ¶
Functions ¶
func IsCleanUpNeeded ¶
func IsCleanUpNeeded() bool
Types ¶
type Clients ¶
type Clients struct {
// contains filtered or unexported fields
}
func GetClients ¶
func GetClients() Clients
func (Clients) DynamicClient ¶
func (Clients) GenericClient ¶
func (Clients) KubeClient ¶
func (c Clients) KubeClient() kubernetes.Interface
func (Clients) OperatorClient ¶
func (c Clients) OperatorClient() operatorhelmclient.Interface
type ClusterTransport ¶
type ClusterTransport struct {
KubeConfig string `yaml:"kubeConfig"`
Token string `yaml:"token"`
Endpoint string `yaml:"endpoint"`
CertificateAuthority string `yaml:"certificateAuthority"`
InsecureTLS bool `yaml:"insecureTls"`
}
func (ClusterTransport) RestConfig ¶
func (c ClusterTransport) RestConfig() (*rest.Config, error)
type Config ¶
type Config struct {
ClusterTransport ClusterTransport `yaml:"clusterTransport"`
Controllers []ControllerConfig `yaml:"controllers"`
ModuleSource string
ModuleSourceDockerCfg string
ModuleTagName string
ModuleDigest string
}
type ControllerConfig ¶
type ControllerConfig struct {
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
LabelSelector string `yaml:"labelSelector"`
Containers []string `yaml:"containers"`
LogFilters LogFilters `yaml:"logFilters"`
// contains filtered or unexported fields
}
func (*ControllerConfig) CompiledRegexps ¶
func (c *ControllerConfig) CompiledRegexps() []*regexp.Regexp
type Framework ¶
type Framework struct {
Clients
// contains filtered or unexported fields
}
func NewFramework ¶
func (*Framework) Before ¶
func (f *Framework) Before()
Before creates an isolated namespace for the test. Pass empty prefix to NewFramework to skip namespace creation.
func (*Framework) Create ¶
Create creates resources via the generic client and registers them for cleanup.
func (*Framework) DeferDelete ¶
DeferDelete registers objects for cleanup in After().
func (*Framework) DeferDeleteFunc ¶
DeferDeleteFunc registers a custom cleanup function.
func (*Framework) EnsureCreate ¶
EnsureCreate gets the object by key; if it exists, registers it for cleanup only. If it is not found, creates it via Create (which registers for cleanup).
func (*Framework) EnsureDynamic ¶
func (f *Framework) EnsureDynamic(ctx context.Context, gvr schema.GroupVersionResource, namespace string, desired *unstructured.Unstructured, clusterScoped bool) error
EnsureDynamic creates or updates an unstructured resource via the dynamic client, then registers it for cleanup (once per resource key).
func (*Framework) EnsureDynamicWithoutCleanup ¶
func (f *Framework) EnsureDynamicWithoutCleanup(ctx context.Context, gvr schema.GroupVersionResource, namespace string, desired *unstructured.Unstructured, clusterScoped bool) error
EnsureDynamicWithoutCleanup is like EnsureDynamic but does not register the object for Framework.After().