Skip to content

Remove DatadogAgentEnabled flag#2912

Open
khewonc wants to merge 4 commits intomainfrom
khewonc/remove-ddai-arg
Open

Remove DatadogAgentEnabled flag#2912
khewonc wants to merge 4 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 Report

❌ Patch coverage is 19.67213% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.15%. Comparing base (7c966f8) to head (9916219).

Files with missing lines Patch % Lines
pkg/controller/utils/datadog/metrics_forwarder.go 0.00% 21 Missing ⚠️
cmd/main.go 0.00% 14 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 71.42% 1 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (19.67%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2912      +/-   ##
==========================================
- Coverage   39.99%   39.15%   -0.84%     
==========================================
  Files         320      320              
  Lines       28122    27262     -860     
==========================================
- Hits        11247    10675     -572     
+ Misses      16052    15844     -208     
+ Partials      823      743      -80     
Flag Coverage Δ
unittests 39.15% <19.67%> (-0.84%) ⬇️

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.60%) ⬆️
...controller/datadogagent/controller_reconcile_v2.go 51.54% <100.00%> (-9.46%) ⬇️
...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 63.63% <ø> (ø)
internal/controller/datadogagent/finalizer.go 50.98% <ø> (-8.73%) ⬇️
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 7c966f8...9916219. 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

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: -1.00% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: -1.00%
Overall Coverage: 39.38% (-0.70%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9916219 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

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.

2 participants