Skip to content

Remove UpdateEnv on some host-based tests - #49271

Closed
KevinFairise2 wants to merge 27 commits into
mainfrom
kfairise/experiment-removal-updatenv
Closed

Remove UpdateEnv on some host-based tests#49271
KevinFairise2 wants to merge 27 commits into
mainfrom
kfairise/experiment-removal-updatenv

Conversation

@KevinFairise2

Copy link
Copy Markdown
Member

What does this PR do?

Motivation

Describe how you validated your changes

Additional Notes

@agent-platform-auto-pr

agent-platform-auto-pr Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor 5f8e5a2a:

Results for datadog-agent_7.79.0~devel.git.612.3c4ec1d.pipeline.108036852-1_amd64.deb:

No change detected

KevinFairise2 and others added 6 commits April 16, 2026 17:14
…tion

Options like WithLogs, WithTags, WithHostname, and WithIntakeHostname populated
ExtraAgentConfig ([]pulumi.StringInput) which cannot be resolved outside a Pulumi
context. Add parallel ExtraAgentConfigRaw []string fields to agentparams.Params
and kubernetesagentparams.Params so these options work when the agent is configured
via SSH or Helm without Pulumi.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Configure(t, opts...), SetBaseOptions, and SetComponents to RemoteHostAgent
so agent config can be written via SSH without re-running Pulumi. Configure merges
new options on top of the stored baseline, builds the full datadog.yaml (with
fakeintake URLs, API key, and user config), writes it via SSH, and restarts the
agent with OS-aware service management (systemctl / initctl / service fallback).

Host.Init now wires SetComponents automatically so Configure has access to the
host (SSH) and fakeintake (URLs) from the start.

SetAgentConfig is kept as a thin shim for backward compatibility but now
delegates to Agent.Configure instead of duplicating the logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…stWorkload

Add KubernetesAgentInstaller interface, Configure(t, opts...), and SetBaseOptions
to KubernetesAgent. Configure delegates to the installer's Upgrade method so
the agent can be reconfigured mid-test via Helm without re-running Pulumi.

Add WithoutDeployTestWorkload() KinD run option for tests that manage workload
deployment themselves in SetupSuite rather than relying on the provisioner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hostagent.Install / InstallOnHost: installs the Datadog Agent on a remote host
via SSH by running the official install script (DD_INSTALL_ONLY=true), then
calls Configure to write config and start the agent. Version defaults are read
from the runner profile (pipeline ID, major version, channel, flavor).

helmagent.Install: installs the agent on a Kubernetes cluster via Helm CLI.
Creates the namespace and API key secret, builds a values YAML matching the
full Pulumi-path configuration (kubelet TLS settings, EC2 metadata timeout,
cluster name, fakeintake URLs), pins the chart to the same version as the
Pulumi path, and runs helm upgrade --install. The helmInstaller returned
implements KubernetesAgentInstaller so Agent.Configure works for mid-test
reconfiguration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Provisioners are now infrastructure-only: VM + fakeintake (+ docker manager
where needed). Custom provisioners set env.Agent = nil so the framework skips
resource import for that field. Agent installation moves to SetupSuite via
hostagent.Install or helmagent.Install.

Mid-test config changes use Agent.Configure instead of UpdateEnv, which
avoids re-running Pulumi for config-only changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added long review PR is complex, plan time to review it and removed medium review PR review might take time labels Apr 29, 2026
KevinFairise2 and others added 13 commits April 29, 2026 13:44
…ent.Configure

Replace UpdateEnv calls for config-only agent changes with Agent.Configure.
No infrastructure is re-provisioned — config is written via SSH and the agent
is restarted in-place.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace UpdateEnv calls for config-only agent changes with Agent.Configure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace UpdateEnv calls for config-only agent changes with Agent.Configure.
The multi-fakeintake test (forwarder_nss_failover) now installs a bare agent
in SetupSuite (no intake config) and applies the intake config inside the test
method via Agent.Configure, avoiding a race where BeforeTest's "both intakes
empty" check would fail because the agent was already sending to fakeintake1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gure

Replace UpdateEnv calls for config-only agent changes with Agent.Configure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a workloads installer package that deploys standard test workload
applications to a Kubernetes cluster without Pulumi. Each workload is defined
as an embedded YAML Go template that is rendered and applied via kubectl.

Workloads covered:
- nginx: Deployment + ConfigMap + Service + PDB (with autodiscovery annotations)
- redis: Deployment + Service + PDB (with endpoints autodiscovery annotation)
- tracegen: UDS and TCP Deployments
- prometheus: Deployment with prometheus.io/scrape annotation
- dogstatsd: six Deployment variants (UDS-with-CSI, UDS, UDP, origin-detection,
  container-name-injected, external-data-only)
- cpustress: stress-ng Deployment
- etcd: Deployment (etcd + config sidecar) + Service
- mutated: three Deployments across two namespaces for admission controller testing

Usage in SetupSuite:

    workloads.Deploy(s.T(), s.Env(),
        workloads.WithNginx(),
        workloads.WithRedis(),
    )

Or deploy the full standard set:

    workloads.DeployTestWorkload(s.T(), s.Env())

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove scenkind.WithDeployTestWorkload() from the provisioner and call
workloads.DeployTestWorkload() in SetupSuite instead. The provisioner
now creates infrastructure only (cluster + fakeintake + agent via Helm);
workload apps are deployed after provisioning via kubectl apply.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Workload

Remove WithDeployTestWorkload() from the provisioner in both suites and
call workloads.DeployTestWorkload() in SetupSuite instead. The orchestrator
suite gains a SetupSuite() for the first time to host the workload deploy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The provisioner now creates cluster + fakeintake only (no agent).
SetupSuite calls helmagent.Install with the same options that kindvm/run.go
was previously injecting via Pulumi:
- KinD-specific kubelet/CSI/hostnetwork values
- stackid tag derived from cluster name
- dual shipping, log level, container helm values, endpoint slices

Also populate LinuxClusterChecks.LabelSelectors in helmagent.Install so
test helpers that reference cluster-checks-runner pods get the right selector.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@agent-platform-auto-pr

agent-platform-auto-pr Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 5f8e5a2
📊 Static Quality Gates Dashboard
🔗 SQG Job
SOME SIZE DELTAS ARE N/A (ANCESTOR METRICS NOT YET AVAILABLE). RETRY JOB

Successful checks

Info

Quality gate Change Size (prev → curr → max)
agent_deb_amd64 N/A N/A → 755.646 → 757.690
agent_deb_amd64_fips N/A N/A → 712.362 → 718.060
agent_heroku_amd64 N/A N/A → 313.323 → 322.130
agent_rpm_amd64 N/A N/A → 755.629 → 757.660
agent_rpm_amd64_fips N/A N/A → 712.346 → 718.040
agent_rpm_arm64 N/A N/A → 733.784 → 739.380
agent_rpm_arm64_fips N/A N/A → 693.584 → 700.780
agent_suse_amd64 N/A N/A → 755.629 → 757.660
agent_suse_amd64_fips N/A N/A → 712.346 → 718.040
agent_suse_arm64 N/A N/A → 733.784 → 739.380
agent_suse_arm64_fips N/A N/A → 693.584 → 700.780
docker_agent_amd64 N/A N/A → 815.896 → 820.010
docker_agent_arm64 N/A N/A → 818.865 → 826.060
docker_agent_jmx_amd64 N/A N/A → 1006.812 → 1010.890
docker_agent_jmx_arm64 N/A N/A → 998.559 → 1005.660
docker_cluster_agent_amd64 N/A N/A → 205.474 → 207.600
docker_cluster_agent_arm64 N/A N/A → 219.697 → 221.150
docker_cws_instrumentation_amd64 N/A N/A → 7.142 → 7.180
docker_cws_instrumentation_arm64 N/A N/A → 6.689 → 6.920
docker_dogstatsd_amd64 N/A N/A → 39.445 → 39.540
docker_dogstatsd_arm64 N/A N/A → 37.698 → 38.080
dogstatsd_deb_amd64 N/A N/A → 30.098 → 30.770
dogstatsd_deb_arm64 N/A N/A → 28.239 → 29.270
dogstatsd_rpm_amd64 N/A N/A → 30.098 → 30.770
dogstatsd_suse_amd64 N/A N/A → 30.098 → 30.770
iot_agent_deb_amd64 N/A N/A → 44.158 → 44.970
iot_agent_deb_arm64 N/A N/A → 41.158 → 42.560
iot_agent_deb_armhf N/A N/A → 41.891 → 42.740
iot_agent_rpm_amd64 N/A N/A → 44.159 → 44.970
iot_agent_suse_amd64 N/A N/A → 44.159 → 44.970
On-wire sizes (compressed)
Quality gate Change Size (prev → curr → max)
agent_deb_amd64 N/A N/A → 175.740 → 179.410
agent_deb_amd64_fips N/A N/A → 167.063 → 174.660
agent_heroku_amd64 N/A N/A → 75.192 → 80.310
agent_rpm_amd64 N/A N/A → 177.758 → 182.280
agent_rpm_amd64_fips N/A N/A → 168.637 → 174.430
agent_rpm_arm64 N/A N/A → 160.166 → 163.800
agent_rpm_arm64_fips N/A N/A → 152.172 → 157.120
agent_suse_amd64 N/A N/A → 177.758 → 182.280
agent_suse_amd64_fips N/A N/A → 168.637 → 174.430
agent_suse_arm64 N/A N/A → 160.166 → 163.800
agent_suse_arm64_fips N/A N/A → 152.172 → 157.120
docker_agent_amd64 N/A N/A → 269.570 → 274.040
docker_agent_arm64 N/A N/A → 256.656 → 262.520
docker_agent_jmx_amd64 N/A N/A → 338.221 → 342.660
docker_agent_jmx_arm64 N/A N/A → 321.285 → 327.100
docker_cluster_agent_amd64 N/A N/A → 71.990 → 73.460
docker_cluster_agent_arm64 N/A N/A → 67.531 → 68.680
docker_cws_instrumentation_amd64 N/A N/A → 2.999 → 3.330
docker_cws_instrumentation_arm64 N/A N/A → 2.729 → 3.090
docker_dogstatsd_amd64 N/A N/A → 15.237 → 15.870
docker_dogstatsd_arm64 N/A N/A → 14.555 → 14.890
dogstatsd_deb_amd64 N/A N/A → 7.942 → 8.830
dogstatsd_deb_arm64 N/A N/A → 6.827 → 7.750
dogstatsd_rpm_amd64 N/A N/A → 7.952 → 8.840
dogstatsd_suse_amd64 N/A N/A → 7.952 → 8.840
iot_agent_deb_amd64 N/A N/A → 11.629 → 13.210
iot_agent_deb_arm64 N/A N/A → 9.938 → 11.620
iot_agent_deb_armhf N/A N/A → 10.142 → 11.780
iot_agent_rpm_amd64 N/A N/A → 11.643 → 13.230
iot_agent_suse_amd64 N/A N/A → 11.643 → 13.230

@KevinFairise2

Copy link
Copy Markdown
Member Author

/trigger-ci

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented May 11, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-05-11 09:15:16 UTC ℹ️ Start processing command /trigger-ci


2026-05-11 09:16:12 UTC ℹ️ Gitlab pipeline started

Started pipeline #112417241

@dd-octo-sts

dd-octo-sts Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had activity in the past 15 days.

It will be closed in 30 days if no further activity occurs. If this pull request is still relevant, adding a comment or pushing new commits will keep it open. Also, you can always reopen the pull request if you missed the window.

Thank you for your contributions!

@dd-octo-sts dd-octo-sts Bot added the stale label May 26, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This pull request was automatically closed because it has been stale for 15 days with no activity.

If this pull request is still relevant, please reopen it or create a new pull request with updated information.

Thanks!

@dd-octo-sts dd-octo-sts Bot closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant