Skip to content

Skip component registry reconciliation for profile DDAIs#2668

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits intomainfrom
tbavelier/do-not-reconcile-components-from-ddai-profiles
Feb 27, 2026
Merged

Skip component registry reconciliation for profile DDAIs#2668
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits intomainfrom
tbavelier/do-not-reconcile-components-from-ddai-profiles

Conversation

@tbavelier
Copy link
Member

@tbavelier tbavelier commented Feb 27, 2026

What does this PR do?

Guards ReconcileComponents with isDDAILabeledWithProfile so that profile DDAIs no longer attempt to reconcile cluster-level components (DCA, CCR, OTel Gateway).

Motivation

PR #2651 introduced a regression where profile DDAIs delete the cluster agent and CCR deployments managed by the main DDAI, causing a delete/recreate loop.

Root cause: Profile DDAIs inherit the parent DDA's name overrides (via SSA merge) alongside disabled=true for cluster-level components. #2651 (or rather #2635 which was the base commit for 2651) added override.Deployment() in the Cleanup function to resolve the correct deployment name (see #2635 description for the bug it fixed). This causes profile DDAIs to resolve the real deployment name and delete it, instead of the harmless no-op it was before (trying to delete a non-existent deployment named after the profile DDAI).

Describe your test plan

  1. Deploy a DDA with spec.override.clusterAgent.name set (name override)
  2. Create a DatadogAgentProfile targeting some nodes
  3. Verify the cluster agent deployment is not deleted/recreated in a loop

Will also test on staging

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)

🤖 Generated with Claude Code

Profile DDAIs only manage the Node Agent DaemonSet and should never
reconcile cluster-level components (DCA, CCR, OTel Gateway).

Previously this was harmless because the Cleanup function generated
deployment names from the profile DDAI name (e.g.
"profile-name-cluster-agent"), which never matched existing deployments.
PR #2651 added override.Deployment() in Cleanup to resolve the correct
deployment name via name overrides. Since profile DDAIs inherit the
parent DDA's name overrides (via SSA merge) alongside disabled=true,
Cleanup now resolves the real deployment name and deletes it, causing a
delete/recreate loop with the main DDAI.

Guard ReconcileComponents with isDDAILabeledWithProfile, consistent with
the existing guards for dependency management and cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tbavelier tbavelier requested a review from a team February 27, 2026 14:41
@tbavelier tbavelier requested a review from a team as a code owner February 27, 2026 14:41
@tbavelier tbavelier added the bug Something isn't working label Feb 27, 2026
@tbavelier tbavelier added this to the v1.25.0 milestone Feb 27, 2026
Copy link

@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: 943f99360b

ℹ️ 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".

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.69%. Comparing base (dba26b8) to head (3a59067).

Files with missing lines Patch % Lines
...er/datadogagentinternal/controller_reconcile_v2.go 0.00% 11 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2668      +/-   ##
==========================================
- Coverage   38.69%   38.69%   -0.01%     
==========================================
  Files         307      307              
  Lines       26525    26526       +1     
==========================================
  Hits        10265    10265              
- Misses      15494    15495       +1     
  Partials      766      766              
Flag Coverage Δ
unittests 38.69% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...er/datadogagentinternal/controller_reconcile_v2.go 0.00% <0.00%> (ø)

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 dba26b8...3a59067. Read the comment docs.

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

@levan-m
Copy link
Collaborator

levan-m commented Feb 27, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link

gh-worker-devflow-routing-ef8351 bot commented Feb 27, 2026

View all feedbacks in Devflow UI.

2026-02-27 20:32:15 UTC ℹ️ Start processing command /merge


2026-02-27 20:32:21 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-02-27 21:09:10 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 2h (p90).


2026-02-27 22:43:13 UTC ℹ️ MergeQueue: This merge request was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants