Scope profile label removal on nodes to deleted profile only in DDAI #3643
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 244 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3643"
general
weight: 0.35
khewonc
What does this PR do?
When deleting a DDAI, the operator would delete profile labels from all nodes, not only the the label scoped to the deleted profile. This could cause a race between how quickly profile nodes were relabeled and how quickly pods were created for the default daemonset while there was no profile label. After profile labels were readded, the new default ds pods could not be scheduled and stayed Pending
Motivation
#incident-62436
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
1. Deploy operator with profiles enabled
2. Apply two profiles that each match a different node. For example, profile-a matches node-1 and profile-b matches node-2
3. Wait until the nodes are labeled:
kubectl get nodes -L agent.datadoghq.com/datadogagentprofile. Using the above example, node-1 should show profile-a and node-2 should show profile-b4. Watch the node labels:
kubectl get nodes -L agent.datadoghq.com/datadogagentprofile -w5. Watch the agent pods: kubectl get pods -w
6. In another terminal, delete profile-a:
kubectl delete dap profile-a7. In the terminal watching node labels, we expect node-1 (profile-a) to lose its label, but node-2 should remain the same
8. In the terminal watching agent pods, we expect no new default agent pods to appear
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits