framework

package
v0.0.0-...-43e8424 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespacePrefix = "e2e"
	E2ELabel        = "e2e-test"
)
View Source
const PostCleanUpEnv = "E2E_POST_CLEANUP"

Variables

View Source
var (
	ShortTimeout    = getTimeout(shortTimeoutEnv, 30*time.Second)
	MiddleTimeout   = getTimeout(middleTimeoutEnv, 60*time.Second)
	LongTimeout     = getTimeout(longTimeoutEnv, 600*time.Second)
	MaxTimeout      = getTimeout(maxTimeoutEnv, 900*time.Second)
	PollingInterval = 5 * time.Second
)

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 (c Clients) DynamicClient() dynamic.Interface

func (Clients) GenericClient

func (c Clients) GenericClient() client.Client

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
}

func GetConfig

func GetConfig() *Config

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 NewFramework(prefix string) *Framework

func (*Framework) After

func (f *Framework) After()

After handles cleanup and dump on failure.

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

func (f *Framework) Create(ctx context.Context, objs ...client.Object) error

Create creates resources via the generic client and registers them for cleanup.

func (*Framework) DeferDelete

func (f *Framework) DeferDelete(objs ...client.Object)

DeferDelete registers objects for cleanup in After().

func (*Framework) DeferDeleteFunc

func (f *Framework) DeferDeleteFunc(fn func() error)

DeferDeleteFunc registers a custom cleanup function.

func (*Framework) EnsureCreate

func (f *Framework) EnsureCreate(ctx context.Context, obj client.Object) error

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().

func (*Framework) Namespace

func (f *Framework) Namespace() *corev1.Namespace

func (*Framework) NamespaceName

func (f *Framework) NamespaceName() string

type LogFilters

type LogFilters struct {
	Exclude       []string `yaml:"exclude"`
	ExcludeRegexp []string `yaml:"excludeRegexp"`
}

Jump to

Keyboard shortcuts

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