ssi

package
v0.82.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package ssi provides end to end tests for Single Step Instrumentation. It focuses on user configuration and how that impacts targeting in Kubernetes.

Index

Constants

View Source
const DefaultAppName = "test-app"

Variables

View Source
var DefaultExpectedContainers = []string{DefaultAppName}

Functions

func FindPodInNamespace

func FindPodInNamespace(t *testing.T, client kubeClient.Interface, namespace string, appName string) *corev1.Pod

func FindTracesForService

func FindTracesForService(t *testing.T, intake *fakeintake.Client, serviceName string) []*trace.TracerPayload

func GetPodsInNamespace

func GetPodsInNamespace(t *testing.T, client kubeClient.Interface, namespace string) []corev1.Pod

func Provisioner added in v0.77.0

Provisioner returns a Kubernetes provisioner based on E2E_PROVISIONER and E2E_DEV_LOCAL parameters. Supported provisioners: "kind" (default), "kind-local", "eks", "gke", "gke-autopilot", "aks", "openshift", "openshift-local". E2E_DEV_LOCAL=true is a shortcut for E2E_PROVISIONER=kind-local.

func RestartPod

func RestartPod(t *testing.T, client kubeClient.Interface, namespace string, appName string)

RestartPod deletes the pod backing appName so its Deployment recreates it, forcing a fresh pass through the admission webhook. It blocks until a new running pod (different from the deleted one) is observed.

func WaitForAdmissionWebhookReady

func WaitForAdmissionWebhookReady(t *testing.T, client kubeClient.Interface)

WaitForAdmissionWebhookReady blocks until the Datadog mutating webhook configuration exists. The cluster agent creates it only after acquiring leadership and reconciling the admission controller, which on slow clusters (e.g. GKE Autopilot, where nodes are provisioned on demand) can lag well behind the Helm release being reported ready.

func WaitForMutatedPodInNamespace

func WaitForMutatedPodInNamespace(t *testing.T, client kubeClient.Interface, namespace string, appName string) *corev1.Pod

WaitForMutatedPodInNamespace returns a pod matching appName in the namespace that has been processed by the APM admission webhook (i.e. carries at least one internal.apm.datadoghq.com/* annotation).

Pod mutation annotations are set at admission time (pod creation), so a pod that was admitted before the webhook was serving is never processed retroactively (failurePolicy is Ignore). This happens for the application pods created during provisioning on slow clusters (e.g. GKE Autopilot) where the cluster agent admission controller comes up well after the Helm release is ready.

To get a mutated pod we therefore wait (without restarting) for the webhook to exist, then recreate the pod so it goes through it. A short retry absorbs the brief gap between the webhook configuration being created and its endpoint actually serving. On clusters where the webhook was already serving, the first matching pod is returned without any restart.

Types

type PreAgentHook added in v0.79.0

type PreAgentHook func(e config.Env, kubeProvider *kubernetes.Provider) error

PreAgentHook lets tests inject setup after the provider is ready and before agent installation.

type ProvisionerOptions added in v0.77.0

type ProvisionerOptions struct {
	AgentOptions                  []kubernetesagentparams.Option
	PreAgentHook                  PreAgentHook
	WorkloadAppFunc               kubeComp.WorkloadAppFunc
	AgentDependentWorkloadAppFunc kubeComp.AgentDependentWorkloadAppFunc
}

ProvisionerOptions contains the common options for Kubernetes provisioners.

type ProvisionerType added in v0.78.0

type ProvisionerType string

ProvisionerType represents the type of Kubernetes provisioner to use.

const (
	// ProvisionerKindAWS uses Kind running on an AWS VM (default).
	ProvisionerKindAWS ProvisionerType = "kind"
	// ProvisionerKindLocal uses Kind running locally.
	ProvisionerKindLocal ProvisionerType = "kind-local"
	// ProvisionerEKS uses Amazon EKS.
	ProvisionerEKS ProvisionerType = "eks"
	// ProvisionerAKS uses Azure Kubernetes Service.
	ProvisionerAKS ProvisionerType = "aks"
	// ProvisionerGKE uses Google Kubernetes Engine.
	ProvisionerGKE ProvisionerType = "gke"
	// ProvisionerGKEAutopilot uses Google Kubernetes Engine in Autopilot mode.
	ProvisionerGKEAutopilot ProvisionerType = "gke-autopilot"
	// ProvisionerOpenShift uses OpenShift VM on GCP.
	ProvisionerOpenShift ProvisionerType = "openshift"
	// ProvisionerOpenShiftLocal uses local OpenShift (CRC).
	ProvisionerOpenShiftLocal ProvisionerType = "openshift-local"
)

Jump to

Keyboard shortcuts

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