common

package
v0.0.0-...-6ae82ab Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FluentdImageRepo      = "fluentd-full"
	FluentdImageTag       = "local"
	ConfigReloaderRepo    = "config-reloader"
	ConfigReloaderTag     = "local"
	SyslogNGReloaderRepo  = "syslog-ng-reloader"
	SyslogNGReloaderTag   = "local"
	FluentdDrainWatchRepo = "fluentd-drain-watch"
	FluentdDrainWatchTag  = "local"
	NodeExporterRepo      = "node-exporter"
	NodeExporterTag       = "local"
)
View Source
const KindClusterCreationTimeout = "3m"

KindClusterCreationTimeout is passed to `kind create cluster --wait`, which bounds only the last of kind's actions, waiting for control plane readiness. The whole invocation is bounded by Kind.CommandTimeout instead.

Variables

This section is empty.

Functions

func CmdEnv

func CmdEnv(cmd *exec.Cmd, c Cluster) *exec.Cmd

func DeleteTestCluster

func DeleteTestCluster(clusterName string) error

func Initialize

func Initialize(t *testing.T)

func KindClusterKubeconfig

func KindClusterKubeconfig(name string) ([]byte, error)

func LoggingInfra

func LoggingInfra(
	ctx context.Context,
	t *testing.T,
	c client.Client,
	nsInfra string,
	release string,
	tag string,
	buffer *output.Buffer,
	producerLabels map[string]string,
)

func LoggingRoute

func LoggingRoute(ctx context.Context, t *testing.T, c client.Client)

func LoggingTenant

func LoggingTenant(
	ctx context.Context,
	t *testing.T,
	c client.Client,
	nsTenant,
	nsInfra,
	release,
	tag string,
	buffer *output.Buffer,
	producerLabels map[string]string,
)

func RequireNoError

func RequireNoError(t *testing.T, err error)

func Resource

func Resource(obj client.Object, ns, name string) client.Object

func SetupCurlPod

func SetupCurlPod(ctx context.Context, c client.Client, namespace, name string, pollInterval, pollTimeout time.Duration) (*corev1.Pod, error)

SetupCurlPod creates a curl pod for testing HTTP endpoints and waits for it to be ready

func WaitForPodReady

func WaitForPodReady(ctx context.Context, c client.Client, pod *corev1.Pod, pollInterval, pollTimeout time.Duration) error

WaitForPodReady waits for a pod to be in Running phase and Ready condition

func WithCluster

func WithCluster(name string, t *testing.T, fn func(*testing.T, Cluster), beforeCleanup func(*testing.T, Cluster) error, opts ...cluster.Option)

Types

type Cluster

type Cluster interface {
	cluster.Cluster
	LoadImages(images ...string) error
	Cleanup() error
	PrintLogs(config PrintLogConfig) error
	KubeConfigFilePath() string
	CollectTestCoverageFiles(string, string) error
}

func GetTestCluster

func GetTestCluster(clusterName string, opts ...cluster.Option) (Cluster, error)

type PrintLogConfig

type PrintLogConfig struct {
	Namespaces []string
	FilePath   string
	Limit      int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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