Cleanup stale Agents not matching DAP when DDAI is enabled#2657
Merged
Cleanup stale Agents not matching DAP when DDAI is enabled#2657
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2657 +/- ##
==========================================
+ Coverage 38.69% 38.83% +0.13%
==========================================
Files 307 307
Lines 26563 26599 +36
==========================================
+ Hits 10278 10329 +51
+ Misses 15511 15490 -21
- Partials 774 780 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
khewonc
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds logic to DDAI reconciler to cleanup Agents which don't match pod affinity of DAP they were created for (due to label changes). DDA path had this logic and wasn't carried over due to this unresolved bug kubernetes/kubernetes#129196. This change primarily targets k8s distros where kubernetes/kubernetes#129196 is resolved.
CONTP-1338
Motivation
What inspired you to submit this pull request?
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?
Describe your test plan
Test below scenario on a distro where kubernetes/kubernetes#129196 is not fixed, first with Operator 1.22-1.23, then fixed version.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel