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 ¶
- func TestScheme() *runtime.Scheme
- type CheckAnnotationIsPresent
- type CheckAnnotationsIsNotPresent
- type CheckContainerDeepEqualIsPresent
- type CheckContainerNameIsPresentFunc
- type CheckEnvFromIsPresent
- type CheckEnvVarIsPresent
- type CheckExtendedDaemonSetFunc
- type CheckLabelIsNotPresent
- type CheckLabelIsPresent
- type CheckNameNamespace
- type CheckObjectMeta
- type CheckPodTemplateFunc
- type CheckVolumeIsNotPresent
- type CheckVolumeIsPresent
- type CheckVolumeMountIsPresent
- type ContainerCheckInterface
- type ObjetMetaCheckInterface
- type PodTemplateSpecCheckInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestScheme ¶
TestScheme return a runtime.Scheme for testing purposes
Types ¶
type CheckAnnotationIsPresent ¶
CheckAnnotationIsPresent used to check if an annotation (key,value) is present on a metav1.ObjectMeta object.
func (*CheckAnnotationIsPresent) Check ¶
func (c *CheckAnnotationIsPresent) Check(t *testing.T, obj *metav1.ObjectMeta) error
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 ¶
func (c *CheckAnnotationsIsNotPresent) Check(t *testing.T, obj *metav1.ObjectMeta) error
Check used to check if an annotation (key,value) is not present on a metav1.ObjectMeta object.
type CheckContainerDeepEqualIsPresent ¶
CheckContainerDeepEqualIsPresent used to check if corev1.Container is equal to a container inside a corev1.PodTemplateSpec object.
func (*CheckContainerDeepEqualIsPresent) Check ¶
func (c *CheckContainerDeepEqualIsPresent) Check(t *testing.T, podTemplate *corev1.PodTemplateSpec) error
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 ¶
func (c *CheckContainerNameIsPresentFunc) Check(t *testing.T, podTemplate *corev1.PodTemplateSpec) error
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
type CheckEnvVarIsPresent ¶
CheckEnvVarIsPresent 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 ¶
func (c *CheckLabelIsNotPresent) Check(t *testing.T, obj *metav1.ObjectMeta) error
Check used to check if a label key is not present on a metav1.ObjectMeta object.
type CheckLabelIsPresent ¶
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 ¶
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 ¶
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 ¶
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
type ContainerCheckInterface ¶
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.