[Backport v1.32] Let the Agent own PAR self-enrollment defaults #3692
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 430 lines diff across 5 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.363
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #3692"
general
weight: 0.35
dd-gplassard
Backport 72c65e857bdc281578fcde10b9c19f9ffade50cf from #3623.
___
What does this PR do?
Leave
private_action_runner.self_enrollunset when omitted, so the Agent owns its runtime default rather than the Operator duplicating it.Represent the setting as an optional boolean. Preserve explicit
trueandfalse, and omit the environment variable when unset. Provision the existing Cluster Agent enrollment-secret Role and RoleBinding unless self-enrollment or Kubernetes identity storage is explicitly disabled. The mounted configuration YAML remains unchanged.Motivation
The Agent already defaults self-enrollment to true, but the Operator decoded an omitted value into a zero-valued Go bool. Since that value gates enrollment RBAC creation, the Operator could omit the enrollment permissions even while the Agent attempted to self-enroll.
Additional Notes
This change does not alter how PAR is enabled (annotations or Kubernetes Actions), RBAC policy contents, split mode, or node Agent configuration. File-backed identities receive no enrollment-secret Role/RoleBinding; separately enabled remediation permissions are preserved. Existing permissions may mask the mismatch in an already-configured cluster.
Companion Helm change: DataDog/helm-charts#2986. Neither integration should override an omitted Agent setting.
Minimum Agent Versions
No new minimum versions introduced. Runtime behavior for an omitted setting remains determined by the selected Agent version.
Describe your test plan
TZ=UTC go test ./internal/controller/datadogagent/feature/privateactionrunner -race -count=1.go test ./internal/controller/datadogagent/feature/privateactionrunner -count=1make lint(zero issues)TZ=UTC go test ./... ./api/...The initial full-suite run in the local timezone failed in unrelated
Test_getDashboardandTest_getMonitortime-location comparisons; the UTC run passed. Subsequent live before/after QA on Kind/Kubernetes 1.34 with Cluster Agent 7.84.1 confirmed the missing-Role regression and this PR's gating fix. Fresh enrollment still encounters pre-existing secret-name/create-permission defects, addressed in stacked PR #3678; this PR alone is not an end-to-end enrollment fix. File-backed enrollment and preservation of remediation permissions were live-tested in the combined stack. The latest parent-only file-storage change was validated with regression tests, race tests, the full Go suite, and lint.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits