utils

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecInPod

func ExecInPod(t *testing.T, f *framework.Framework, namespace string, pod string, container string, command []string) (string, string, error)

ExecInPod executes a command in a running ready pod and returns its stdout and stderr outputs

func FindPodsByLabels

func FindPodsByLabels(t *testing.T, client framework.FrameworkClient, namespace string, labelSelector string) (*corev1.PodList, error)

FindPodsByLabels looks up pods in a namespace using a label selector

func NewDatadogAgent

func NewDatadogAgent(ns, name, image string, options *NewDatadogAgentOptions) *datadoghqv1alpha1.DatadogAgent

NewDatadogAgent returns new DatadogAgent instance with is config hash

func UpdateDatadogAgentFunc

func UpdateDatadogAgentFunc(f *framework.Framework, namespace, name string, updateFunc func(ad *datadoghqv1alpha1.DatadogAgent), retryInterval, timeout time.Duration) error

UpdateDatadogAgentFunc used to update a DatadogAgent with retry and timeout policy

func WaitForExecInPod

func WaitForExecInPod(t *testing.T, f *framework.Framework, namespace string, pod string, container string, command []string, validate ExecValidationFunc, retryInterval, timeout time.Duration) error

WaitForExecInPod is used to wait for a condition based on execution of a command in a running pod

func WaitForFuncOnClusterAgentDeployment

func WaitForFuncOnClusterAgentDeployment(t *testing.T, client framework.FrameworkClient, namespace, name string, f func(dca *appsv1.Deployment) (bool, error), retryInterval, timeout time.Duration) error

WaitForFuncOnClusterAgentDeployment used to wait a valid condition on a Cluster Agent Deployment

func WaitForFuncOnDaemonSet

func WaitForFuncOnDaemonSet(t *testing.T, client framework.FrameworkClient, namespace, name string, f func(ds *appsv1.DaemonSet) (bool, error), retryInterval, timeout time.Duration) error

WaitForFuncOnDaemonSet used to wait a valid condition on a Daemonset

func WaitForFuncOnDatadogAgent

func WaitForFuncOnDatadogAgent(t *testing.T, client framework.FrameworkClient, namespace, name string, f func(ad *datadoghqv1alpha1.DatadogAgent) (bool, error), retryInterval, timeout time.Duration) error

WaitForFuncOnDatadogAgent used to wait a valid condition on a DatadogAgent

func WaitForFuncOnExtendedDaemonSet

func WaitForFuncOnExtendedDaemonSet(t *testing.T, client framework.FrameworkClient, namespace, name string, f func(eds *edsdatadoghqv1alpha1.ExtendedDaemonSet) (bool, error), retryInterval, timeout time.Duration) error

WaitForFuncOnExtendedDaemonSet used to wait a valid condition on a ExtendedDaemonSet

func WaitForFuncOnPods

func WaitForFuncOnPods(t *testing.T, client framework.FrameworkClient, namespace string, labelSelector string, f func(pod *corev1.Pod) (bool, error), retryInterval, timeout time.Duration) error

WaitForFuncOnPods used to wait a valid condition on list of pods

Types

type ExecValidationFunc

type ExecValidationFunc func(stdout, stderr string, returnErr error) (bool, error)

ExecValidationFunc checks results of a command execution in a running pod

type NewDatadogAgentOptions

type NewDatadogAgentOptions struct {
	ExtraLabels         map[string]string
	ExtraAnnotations    map[string]string
	ClusterAgentEnabled bool
	UseEDS              bool
	APIKey              string
}

NewDatadogAgentOptions used to provide creation options to the NewDatadogAgent function

Jump to

Keyboard shortcuts

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