[CONS-11950] Apply global.registry to the managed CSI driver image #3486
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 · 622 lines diff across 7 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.385
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3486"
general
weight: 0.35
clamoriniere
What does this PR do?
Makes
spec.global.registryapply to the Datadog CSI driver image that the operator manages.spec.registrytoDatadogCSIDriverSpec, propagated by the DatadogAgent controller from the (already defaulted)spec.global.registry.spec.global.csi.image(a dedicatedCSIImageConfig:name,tag,pullPolicy,pullSecrets), propagated tospec.csiDriverImage, so those work while keepingautoManage: true. It deliberately does not reuseAgentImageConfig, whosejmxEnabledonly applies to the Agent image — there is nocsi-driver:<tag>-jmx, so offering the knob could only resolve to a tag that does not exist.imagePullPolicyfrom both image specs into the DaemonSet containers. The CRD accepted the field but nothing ever read it.registrarImage.pullSecretsin the pod'simagePullSecrets. Only the driver's secrets were used, so a relocated registrar could not authenticate.resolveCSIDriverImage, using the existingimages.IsGCRRegistry, so moving the default off hardcoded GCR does not break the Autopilot WorkloadAllowlist.Motivation
CONS-11950 (FR: FRCONS-1268).
spec.global.registryis the documented single place a customer points aDatadogAgentat another container registry, and it already redirects every Agent image plus the Single Step Instrumentation injection images. The CSI driver ignored it:resolveCSIDriverImagehardcodedgcr.io/datadoghq. A customer on a private or mirrored registry who setglobal.csi.enabled: truegot the CSI DaemonSet inImagePullBackOffagainst an egress destination their environment blocks by design, with nothing in the docs explaining why.The only workaround was to opt out of operator management entirely (
autoManage: false) and hand-own theDatadogCSIDriverCR with fullregistry/name:tagimage names, because the operator reverts any image edit on the CR it manages.Additional Notes
Reading this diff. It is ~760 added lines, but only 132 are hand-written source. The split:
| | Lines |
|---|---|
| Generated (
config/crd/*,zz_generated.,docs/configuration.md) | ~400 || Tests | ~230 |
| Hand-written source | ~132 |
Most of the generated bulk is one 48-line CRD block for
global.csi.image, replicated across 3 CRDs x 2 formats becauseGlobalConfigis embedded inDatadogAgent,DatadogAgentInternalandDatadogAgentProfile. Reviewinginternal/,api//_types.goand the tests covers everything of substance; the rest ismake generate && make manifestsoutput.The
global.registryfield documentation is updated to say it covers Agent images, SSI injection images and the CSI driver image.Minimum Agent Versions
None. This only changes which registry the operator resolves images from.
Agent: n/a
Cluster Agent: n/a
Describe your test plan
Unit tests (
go test ./...) andmake lintpass. New coverage:internal/controller/datadogcsidriver:TestResolveImages_Registrytables the registry/override precedence (registry only, empty registry, tag-only override, fullregistry/name:tagoverride winning, registrar unaffected, and the three Autopilot rows);TestBuildDaemonSet_ImagePullPolicyandTestBuildDaemonSet_RegistrarImagePullSecretspin the two newly-honored fields, the latter also asserting theDD_APM_REGISTRY_AUTH_*fallback still uses driver secrets only.internal/controller/datadogagent:TestReconcileDatadogCSIDriver_ImageConfigPropagatedand_ImageConfigIsCopiedcover propagation and that the built CR does not alias the DDA.Manual, with the operator started with
--datadogCSIDriverEnabled=true:1.
DatadogAgentwithglobal.registry: <mirror>andglobal.csi.enabled: true→kubectl get ddcsi <name> -o jsonpath='{.spec.registry}'returns the mirror, and the DaemonSet shows<mirror>/csi-driver:1.4.0with the registrar unchanged onregistry.k8s.io/sig-storage.2. No
global.registry→registry.datadoghq.com/csi-driver:1.4.0.3. Set
global.csi.image.pullSecrets→ the pod template'simagePullSecretsappears.4. Change
global.registryon the DDA → the CR and the DaemonSet converge on the next reconcile.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
[CONS-11950]: https://datadoghq.atlassian.net/browse/CONS-11950?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ