k8stest

package module
v0.0.0-...-fc88eaf Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCollectorObjects

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

func CreateObject

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

func DeleteObject

func DeleteObject(client *K8sClient, 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 *K8sClient, podNamespace string, podLabels map[string]any)

func WaitForTelemetryGenToStart

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

Types

type K8sClient

type K8sClient struct {
	DynamicClient   *dynamic.DynamicClient
	DiscoveryClient *discovery.DiscoveryClient
	Mapper          *restmapper.DeferredDiscoveryRESTMapper
}

func NewK8sClient

func NewK8sClient(kubeconfigPath string) (*K8sClient, error)

type TelemetrygenCreateOpts

type TelemetrygenCreateOpts struct {
	TestID       string
	ManifestsDir string
	OtlpEndpoint string
	DataTypes    []string
}

type TelemetrygenObjInfo

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

func CreateTelemetryGenObjects

func CreateTelemetryGenObjects(t *testing.T, client *K8sClient, createOpts *TelemetrygenCreateOpts) ([]*unstructured.Unstructured, []*TelemetrygenObjInfo)

Jump to

Keyboard shortcuts

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