k8stest

package module
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

README

Kubernetes Test Helpers

The purpose of this package is to provide reusable kubernetes test helpers.

Functionality

This package includes the ability to create and delete k8s objects, run the collector, check data received from the collector, as well as create telemetry generators, all within a k8s environment.

Example usage

Please refer to the k8sattributes processor's e2e test for an example of how to use this package.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCollectorObjects

func CreateCollectorObjects(t *testing.T, client *dynamic.DynamicClient, testID string) []*unstructured.Unstructured

func CreateObject

func CreateObject(client *dynamic.DynamicClient, manifest []byte) (*unstructured.Unstructured, error)

func DeleteObject

func DeleteObject(client *dynamic.DynamicClient, obj *unstructured.Unstructured) error

func HostEndpoint

func HostEndpoint(t *testing.T) string

func SelectorFromMap

func SelectorFromMap(labelMap map[string]any) labels.Selector

func WaitForCollectorToStart

func WaitForCollectorToStart(t *testing.T, client *dynamic.DynamicClient, podNamespace string, podLabels map[string]any)

func WaitForTelemetryGenToStart

func WaitForTelemetryGenToStart(t *testing.T, client *dynamic.DynamicClient, podNamespace string, podLabels map[string]any, workload, dataType string)

Types

type TelemetrygenObjInfo

type TelemetrygenObjInfo struct {
	Namespace         string
	PodLabelSelectors map[string]any
	DataType          string
	Workload          string
}

func CreateTelemetryGenObjects

func CreateTelemetryGenObjects(t *testing.T, client *dynamic.DynamicClient, testID string) ([]*unstructured.Unstructured, []*TelemetrygenObjInfo)

Jump to

Keyboard shortcuts

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