fix(compose): pass CDI device names through unchanged #5236
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 236 lines diff across 2 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.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5236"
general
weight: 0.35
AkihiroSuda
Problem
nerdctl composecannot start a service that requests a CDI device, although the Compose spec allows a CDI qualified name indevices:nerdctl run --device vendor.com/class=nameworks on current main, and Docker Compose starts the same project.Cause
The service parser formats every
devicesentry as--device=<source>:<target>:<permissions>. compose-go fills in the target and permissions for a short entry, so a CDI name gets:vendor.com/class=name:rwmappended.nerdctl runonly treats--deviceas a CDI device when the whole value is a qualified name, so it falls back to parsing a host path and fails.Fix
When the source is a CDI qualified name (
cdiparser.IsQualifiedName), pass it as--device=<name>. Host device entries keep the existing format.Verification
Built from this branch and from its parent commit, and run with
nerdctl compose upagainst a CDI spec whose device only sets an env var. Tested on containerd 2.2.1 and runc 1.3.3. The same project and spec were run through Docker Compose 5.5.0 on Docker 29.7.2 for comparison.|
devicesentry | unpatched | patched | Docker Compose ||---|---|---|---|
|
vendor.com/class=name|failed to parse device, container never created | ran, env from the CDI spec injected | ran, env from the CDI spec injected ||
/dev/null:/dev/probe| ran,/dev/probepresent | ran,/dev/probepresent | ran,/dev/probepresent ||
/dev/null:/dev/probe:rw| ran,/dev/probepresent | ran,/dev/probepresent | ran,/dev/probepresent |Test
TestParseDevicesgains a CDI entry and asserts it becomes--device=vendor.com/class=name.