[profile] keep legacy profile label until DaemonSets migrate #3840
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.71) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.71 · 494 lines diff across 6 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.371
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.071
Real PR Conversation Timeline
1 comments
"Review active on #3840"
general
weight: 0.35
khewonc
What does this PR do?
Stacked on #3839. Makes the upgrade to namespace-scoped profile labels safe:
agent.datadoghq.com/datadogagentprofilenode label until no operator-managed DaemonSet selects with it.agentprofile.LegacyProfileLabelInUsechecks DaemonSets withapp.kubernetes.io/managed-by=datadog-operatorfor the legacy key in required or preferred node affinity.labelNodesWithProfilesonly removes the legacy label once nothing uses it.Applied=Falsewith reasonNoDatadogAgentInNamespace, and itscreateStrategystatus is cleared. Before this, it kept a staleApplied=True. Documented indocs/datadog_agent_profiles.md.Only a single DDA per cluster is supported (with any number of profile DDAIs), so multi-DDA scenarios aren't handled.
Motivation
Reproduced on a 6-node kind cluster by upgrading from the base commit (
379edc6e2) to #3839. The setup was a DAPgpuon 4 nodes, the create strategy enabled, and DaemonSetmaxUnavailable: 1:team-aDAP that had been applied cross-namespace stayedApplied=TrueandcreateStrategy: Completedafter it stopped applying.Additional Notes
spec.override.nodeAgent.affinityreferences the legacy key, that affinity is merged into every DaemonSet, and the legacy label is kept for as long as it stays there.Minimum Agent Versions
N/A
Describe your test plan
go test ./internal/controller/datadogagent/ ./internal/controller/datadogagentinternal/ ./pkg/agentprofile/,make integration-testsandmake lintall pass.DoesNotExist, unmanaged DaemonSets);labelNodesWithProfileskeeping or removing the legacy label; create strategy counting the legacy label;markCrossNamespaceProfiles.- Both labels were present for about 1s. Once the DaemonSets were re-rendered, the legacy label was removed.
- The gpu pods rolled one at a time, about 30s apart: 13:51:42, 13:52:12, 13:52:42, 13:53:13.
- No default pods ran on profile nodes.
-
team-a/edge→Applied=False, reasonNoDatadogAgentInNamespace,createStrategy: null.- No errors in the operator logs.
The kind run used the first commit, which also included the multi-DDA handling removed in the second commit. The single-DDA upgrade path it exercised is unchanged.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
🤖 Generated with Claude Code