testutils_test

package
v1.23.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testutils_test contains a set of unit-test helper functions to ease the creation of unit-test around the DatadogAgent CRD controller

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestScheme

func TestScheme() *runtime.Scheme

TestScheme return a runtime.Scheme for testing purposes

Types

type CheckAnnotationIsPresent

type CheckAnnotationIsPresent struct {
	Key   string
	Value string
}

CheckAnnotationIsPresent used to check if an annotation (key,value) is present on a metav1.ObjectMeta object.

func (*CheckAnnotationIsPresent) Check

Check used to check if an annotation (key,value) is present on a metav1.ObjectMeta object.

type CheckAnnotationsIsNotPresent

type CheckAnnotationsIsNotPresent struct {
	Key string
}

CheckAnnotationsIsNotPresent used to check if a annotation key is not present on a metav1.ObjectMeta object.

func (*CheckAnnotationsIsNotPresent) Check

Check used to check if an annotation (key,value) is not present on a metav1.ObjectMeta object.

type CheckContainerDeepEqualIsPresent

type CheckContainerDeepEqualIsPresent struct {
	Container *corev1.Container
}

CheckContainerDeepEqualIsPresent used to check if corev1.Container is equal to a container inside a corev1.PodTemplateSpec object.

func (*CheckContainerDeepEqualIsPresent) Check

Check used to check if corev1.Container is equal to a container inside a corev1.PodTemplateSpec object.

type CheckContainerNameIsPresentFunc

type CheckContainerNameIsPresentFunc struct {
	Name string
}

CheckContainerNameIsPresentFunc used to check if container name is equal to a container name present in a corev1.PodTemplateSpec object.

func (*CheckContainerNameIsPresentFunc) Check

Check used to check if container name is equal to a container name present in a corev1.PodTemplateSpec object.

type CheckEnvFromIsPresent

type CheckEnvFromIsPresent struct {
	EnvFrom *corev1.EnvFromSource
}

CheckEnvFromIsPresent used to check if an corev1.EnvFromSource is present in a corev1.Container object

func (*CheckEnvFromIsPresent) Check

func (c *CheckEnvFromIsPresent) Check(t *testing.T, container *corev1.Container) error

Check used to check if an corev1.EnvFromSource is present in a corev1.Container object

type CheckEnvVarIsPresent

type CheckEnvVarIsPresent struct {
	EnvVar *corev1.EnvVar
}

CheckEnvVarIsPresent used to check if an corev1.EnvVar is present in a corev1.Container object

func (*CheckEnvVarIsPresent) Check

func (c *CheckEnvVarIsPresent) Check(t *testing.T, container *corev1.Container) error

Check used to check if an corev1.EnvVar is present in a corev1.Container object

type CheckExtendedDaemonSetFunc

type CheckExtendedDaemonSetFunc func(t *testing.T, eds *edsdatadoghqv1alpha1.ExtendedDaemonSet)

CheckExtendedDaemonSetFunc define the signature of ExtendedDaemonSet's Check function.

func CheckMetadaInEDS

func CheckMetadaInEDS(metaCheck ObjetMetaCheckInterface) CheckExtendedDaemonSetFunc

CheckMetadaInEDS used to execute a CheckExtendedDaemonSetFunc function on an ExtendedDaemonSet instance

func CheckPodTemplateInEDS

func CheckPodTemplateInEDS(templateCheck PodTemplateSpecCheckInterface) CheckExtendedDaemonSetFunc

CheckPodTemplateInEDS used to execute a CheckPodTemplateFunc function on an ExtendedDaemonSet instance

type CheckLabelIsNotPresent

type CheckLabelIsNotPresent struct {
	Key string
}

CheckLabelIsNotPresent used to check if a label key is not present on a metav1.ObjectMeta object.

func (*CheckLabelIsNotPresent) Check

Check used to check if a label key is not present on a metav1.ObjectMeta object.

type CheckLabelIsPresent

type CheckLabelIsPresent struct {
	Key   string
	Value string
}

CheckLabelIsPresent used to check if a label (key,value) is present on a metav1.ObjectMeta object.

func (*CheckLabelIsPresent) Check

func (c *CheckLabelIsPresent) Check(t *testing.T, obj *metav1.ObjectMeta) error

Check used to check if a label (key,value) is present on a metav1.ObjectMeta object.

type CheckNameNamespace

type CheckNameNamespace struct {
	Namespace string
	Name      string
}

CheckNameNamespace used to check if the namespace and name are the expected value on a metav1.ObjectMeta.

func (*CheckNameNamespace) Check

func (c *CheckNameNamespace) Check(t *testing.T, obj *metav1.ObjectMeta) error

Check used to check if the namespace and name are the expected value on a metav1.ObjectMeta.

type CheckObjectMeta

type CheckObjectMeta func(t *testing.T, obj *metav1.ObjectMeta)

CheckObjectMeta define the function signature of a check that runs again a metav1.ObjectMeta object.

type CheckPodTemplateFunc

type CheckPodTemplateFunc func(t *testing.T, podTemplate *corev1.PodTemplateSpec)

CheckPodTemplateFunc define the signature of a check function against a corev1.PodTemplateSpec

func CheckContainerInPodTemplate

func CheckContainerInPodTemplate(containerName string, checkFunc ContainerCheckInterface) CheckPodTemplateFunc

CheckContainerInPodTemplate used to execute a ContainerCheckInterface.Check(...) function again a specific container in a corev1.PodTemplateSpec object.

type CheckVolumeIsNotPresent

type CheckVolumeIsNotPresent struct {
	Volume *corev1.Volume
}

CheckVolumeIsNotPresent used to check if a corev1.Volume is not present in a corev1.PodTemplateSpec object.

func (*CheckVolumeIsNotPresent) Check

func (c *CheckVolumeIsNotPresent) Check(t *testing.T, podTemplate *corev1.PodTemplateSpec) error

Check used to check if a corev1.Volume is not present in a corev1.PodTemplateSpec object.

type CheckVolumeIsPresent

type CheckVolumeIsPresent struct {
	Volume *corev1.Volume
}

CheckVolumeIsPresent used to check if a corev1.Volume is present in a corev1.PodTemplateSpec object.

func (*CheckVolumeIsPresent) Check

func (c *CheckVolumeIsPresent) Check(t *testing.T, podTemplate *corev1.PodTemplateSpec) error

Check used to check if a corev1.Volume is present in a corev1.PodTemplateSpec object.

type CheckVolumeMountIsPresent

type CheckVolumeMountIsPresent struct {
	VolumeMount *corev1.VolumeMount
}

CheckVolumeMountIsPresent used to check if an corev1.VolumeMount is present in a corev1.Container object

func (*CheckVolumeMountIsPresent) Check

func (c *CheckVolumeMountIsPresent) Check(t *testing.T, container *corev1.Container) error

Check used to check if an corev1.VolumeMount is present in a corev1.Container object

type ContainerCheckInterface

type ContainerCheckInterface interface {
	Check(t *testing.T, container *corev1.Container) error
}

ContainerCheckInterface interface used by container checks.

type ObjetMetaCheckInterface

type ObjetMetaCheckInterface interface {
	Check(t *testing.T, obj *metav1.ObjectMeta) error
}

ObjetMetaCheckInterface use as ObjectMeta check interface

type PodTemplateSpecCheckInterface

type PodTemplateSpecCheckInterface interface {
	Check(t *testing.T, podTemplate *corev1.PodTemplateSpec) error
}

PodTemplateSpecCheckInterface interface use by PodTemplateSpec checks.

Jump to

Keyboard shortcuts

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