Skip to content

Remove DatadogAgentEnabled flag#2912

Merged
khewonc merged 5 commits intomainfrom
khewonc/remove-ddai-arg
May 6, 2026
Merged

Remove DatadogAgentEnabled flag#2912
khewonc merged 5 commits intomainfrom
khewonc/remove-ddai-arg

Conversation

@khewonc
Copy link
Copy Markdown
Collaborator

@khewonc khewonc commented Apr 16, 2026

What does this PR do?

Remove ddai flag to enable ddai by default. A warning has been in the operator that the flag will be removed in 1.27

Split into commits:

  • 59e423a: updating comments to remove things like "if ddai is enabled" since it's always enabled now. No actual code changes
  • e7093f3: removing the ddai enabled flag + most references
  • 4f4d40c: fmt + lint errors. Mostly removing unused code paths
  • 9916219: check ddai status instead of dda status to check for the agent status. It took up to an extra 15s (reconcile requeue period) per test as we need a reconcile to copy the relevant ddai status to dda, so directly checking the ddai status is quicker

Motivation

https://datadoghq.atlassian.net/browse/CONTP-1535

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

Write there any instructions and details you may have to test your PR.

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
  • All commits are signed (see: signing commits)

@khewonc khewonc added this to the v1.27.0 milestone Apr 16, 2026
@khewonc khewonc requested a review from a team April 16, 2026 19:17
@khewonc khewonc added enhancement New feature or request refactoring labels Apr 16, 2026
Copy link
Copy Markdown

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

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: 9916219665

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread cmd/main.go
Comment on lines 190 to 191
// DatadogAgentInternal
flag.BoolVar(&opts.datadogAgentInternalEnabled, "datadogAgentInternalEnabled", true, "Enable the DatadogAgentInternal controller")
flag.BoolVar(&opts.createControllerRevisions, "createControllerRevisions", false, "Enable creation of ControllerRevision snapshots on each DDA spec change")
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 Preserve deprecated flag until bundled manifests drop it

Removing the datadogAgentInternalEnabled flag here makes the operator exit with flag provided but not defined in deployments that still pass it, and this repository still ships such a deployment (marketplaces/addon_manifest.yaml includes -datadogAgentInternalEnabled=true at line 18373). In that environment the manager never starts and the pod crashloops, so either a compatibility alias should be kept for one release or all shipped manifests using the old flag must be updated in the same change.

Useful? React with 👍 / 👎.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 20.63492% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.62%. Comparing base (59f9e3d) to head (6bd1640).

Files with missing lines Patch % Lines
pkg/controller/utils/datadog/metrics_forwarder.go 0.00% 21 Missing ⚠️
cmd/main.go 0.00% 15 Missing ⚠️
pkg/controller/utils/datadog/forwarders_manager.go 0.00% 8 Missing ⚠️
pkg/agentprofile/agent_profile.go 33.33% 4 Missing ⚠️
internal/controller/setup.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2912      +/-   ##
==========================================
- Coverage   41.39%   40.62%   -0.77%     
==========================================
  Files         331      331              
  Lines       28911    28051     -860     
==========================================
- Hits        11969    11397     -572     
+ Misses      16086    15879     -207     
+ Partials      856      775      -81     
Flag Coverage Δ
unittests 40.62% <20.63%> (-0.77%) ⬇️

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

Files with missing lines Coverage Δ
internal/controller/datadogagent/controller.go 48.00% <ø> (-44.86%) ⬇️
...troller/datadogagent/controller_reconcile_agent.go 69.23% <ø> (+3.91%) ⬆️
...controller/datadogagent/controller_reconcile_v2.go 52.04% <100.00%> (-9.16%) ⬇️
...ler/datadogagent/controller_reconcile_v2_common.go 13.09% <ø> (-20.82%) ⬇️
...er/datadogagent/controller_reconcile_v2_helpers.go 34.48% <ø> (-30.52%) ⬇️
internal/controller/datadogagent/dependencies.go 54.34% <ø> (ø)
internal/controller/datadogagent/finalizer.go 63.33% <ø> (-8.41%) ⬇️
internal/controller/datadogagent/profile.go 72.60% <100.00%> (ø)
internal/controller/datadogagent/store/store.go 68.39% <ø> (ø)
internal/controller/datadogagent/utils.go 11.57% <ø> (-1.23%) ⬇️
... and 8 more

... and 6 files with indirect coverage changes


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 59f9e3d...6bd1640. Read the comment docs.

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

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented Apr 16, 2026

Code Coverage

Fix all issues with BitsAI

🛑 Gate Violations

🎯 1 Code Coverage issue detected

A Patch coverage percentage gate may be blocking this PR.

Patch coverage: 22.03% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 22.03%
Overall Coverage: 40.92% (-0.63%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6bd1640 | Docs | Datadog PR Page | Give us feedback!

@khewonc khewonc merged commit d94085f into main May 6, 2026
39 of 41 checks passed
@khewonc khewonc deleted the khewonc/remove-ddai-arg branch May 6, 2026 13:13
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.

3 participants