Skip to content

Conversation

@swang392
Copy link
Contributor

What does this PR do?

  • Adds helm metadata forwader to pkg/util/metadata which extends from SharedMetadata
  • Adds unit tests for helm metadata forwarder methods
  • Uses agent's scrubber pkg to scrub sensitive keys, secret backends, etc. from the helm values payload so they will not be surfaced.

Motivation

https://datadoghq.atlassian.net/browse/AGENTONB-2594
We want to extend the current metadata forwarding schema in the Operator to also collect metadata on helm values configurations. This is necessary for future work in Agent Onboarding and Fleet Automation.

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

  • Installed multiple helm charts (datadog and datadog-operator)
helm install datadog ~/dd/helm-charts/charts/datadog
helm upgrade datadog-operator datadog/datadog-operator --set image.tag=<custom-image> --set image.doNotCheckTag=true --set image.repository=operator --set logLevel="debug" --set apiKey=xxxxxxx --set datadog.secretBackend.command="/readsecret.sh"
  • verified that helm metadata forwarder started, and payload logs are visible for all helm releases. The payload contains both the provided configuration and full values.yaml.
  • check that secrets are scrubbed:
"helm_provided_configuration\":\"apiKey: \\\"***************************9d257\\\"\\ndatadog:\\n  secretBackend:\\n    command: /readsecret.sh\\nimage:\\n  doNotCheckTag: true\\n  repository: operator\\n  tag: metadata-16\\nlogLevel: debug\"

TBD: test on staging after EVWPR backend is implemented with feature flag

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

@swang392 swang392 added this to the v1.21.0 milestone Oct 28, 2025
@swang392 swang392 added the enhancement New feature or request label Oct 28, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 27.13755% with 196 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.91%. Comparing base (9c5105b) to head (83a2cc6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/utils/metadata/helm_metadata.go 28.51% 179 Missing and 4 partials ⚠️
pkg/controller/utils/metadata/shared_metadata.go 0.00% 8 Missing ⚠️
cmd/main.go 0.00% 4 Missing ⚠️
pkg/controller/utils/metadata/operator_metadata.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2273      +/-   ##
==========================================
- Coverage   38.05%   37.91%   -0.14%     
==========================================
  Files         255      256       +1     
  Lines       20949    21207     +258     
==========================================
+ Hits         7972     8041      +69     
- Misses      12359    12544     +185     
- Partials      618      622       +4     
Flag Coverage Δ
unittests 37.91% <27.13%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/controller/utils/metadata/operator_metadata.go 19.29% <0.00%> (-3.09%) ⬇️
cmd/main.go 0.00% <0.00%> (ø)
pkg/controller/utils/metadata/shared_metadata.go 42.53% <0.00%> (-2.71%) ⬇️
pkg/controller/utils/metadata/helm_metadata.go 28.51% <28.51%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c5105b...83a2cc6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@swang392 swang392 marked this pull request as ready for review October 28, 2025 18:03
@swang392 swang392 requested a review from a team as a code owner October 28, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants