Skip to content

fix(otel-agent): use unique otelconfPath on Windows to avoid duplicate volumeMount - #2746

Open
dudo wants to merge 1 commit into
DataDog:mainfrom
dudo:fix/windows-otel-confpath-unique
Open

fix(otel-agent): use unique otelconfPath on Windows to avoid duplicate volumeMount#2746
dudo wants to merge 1 commit into
DataDog:mainfrom
dudo:fix/windows-otel-confpath-unique

Conversation

@dudo

@dudo dudo commented Jun 22, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes the datadog.otelconfPath Helm template to use a unique directory on Windows (C:/ProgramData/Datadog/otel-agent) instead of the same path as datadog.confPath (C:/ProgramData/Datadog).

Motivation

When datadog.otelCollector.enabled=true with targetSystem=windows, the rendered DaemonSet has two volumeMounts on the otel-agent container pointing to the same mountPath:

volumeMounts:
  - name: config
    mountPath: C:/ProgramData/Datadog    # from datadog.confPath
  - name: otelconfig
    mountPath: C:/ProgramData/Datadog    # from datadog.otelconfPath — DUPLICATE

Kubernetes rejects this:

The DaemonSet "datadog-agent-windows" is invalid:
spec.template.spec.containers[3].volumeMounts[3].mountPath:
Invalid value: "C:/ProgramData/Datadog": must be unique

This makes it impossible to deploy DDOT on Windows via the Helm chart.

Reproducer

helm template test datadog/datadog \
  --set targetSystem=windows \
  --set 'datadog.otelCollector.enabled=true' \
  --set 'datadog.apiKeyExistingSecret=x' | \
  kubectl apply --dry-run=server -f -

The fix

On Linux, these paths are already distinct (/etc/datadog-agent vs /etc/otel-agent). This PR applies the same pattern on Windows:

Template Before After
datadog.confPath (windows) C:/ProgramData/Datadog unchanged
datadog.otelconfPath (windows) C:/ProgramData/Datadog C:/ProgramData/Datadog/otel-agent

@dudo
dudo requested review from a team as code owners June 22, 2026 20:35
@dudo
dudo requested review from ddogDiegoGonzalez and removed request for a team June 22, 2026 20:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70e70ba7f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{{- end -}}
{{- if eq .Values.targetSystem "windows" -}}
C:/ProgramData/Datadog
C:/ProgramData/Datadog/otel-agent

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required chart release artifacts

The project review guide at charts/datadog/docs/internal/agent-review-guide.md says changes to chart templates or chart behavior require a charts/datadog/Chart.yaml version bump, charts/datadog/CHANGELOG.md entry, README regeneration, and updated Datadog Agent baselines. This commit only changes _helpers.tpl, so the Windows DDOT fix can be merged without the release metadata/test artifacts needed for it to be published and verified with the chart.

Useful? React with 👍 / 👎.

The datadog.otelconfPath template resolves to C:/ProgramData/Datadog on
Windows, identical to datadog.confPath. This causes the otel-agent container
to have two volumeMounts at the same mountPath, which Kubernetes rejects:
mountPath must be unique.

Uses C:/ProgramData/Datadog/otel-agent instead, matching the Linux pattern
where confPath (/etc/datadog-agent) and otelconfPath (/etc/otel-agent) are
distinct directories.
@dudo
dudo force-pushed the fix/windows-otel-confpath-unique branch from 70e70ba to 630ecd4 Compare June 22, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant