← Back to Pull requests

fix(compose): pass CDI device names through unchanged #5236

Closed
unknown closed this pull request without merging on Oct 02, 2026 08:30 UTC
View on GitHub
unknown unknown commented on Sep 29, 2026 11:35 UTC
Author

Problem

nerdctl compose cannot start a service that requests a CDI device, although the Compose spec allows a CDI qualified name in devices:

services:
  probe:
    image: alpine
    devices:
      - vendor.com/class=name

FATA[0000] failed to parse device "vendor.com/class=name:vendor.com/class=name:rwm": "vendor.com/class=name" is not an absolute path

nerdctl run --device vendor.com/class=name works on current main, and Docker Compose starts the same project.

Cause

The service parser formats every devices entry 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:rwm appended. nerdctl run only treats --device as 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 up against 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.

| devices entry | 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/probe present | ran, /dev/probe present | ran, /dev/probe present |
| /dev/null:/dev/probe:rw | ran, /dev/probe present | ran, /dev/probe present | ran, /dev/probe present |

Test

TestParseDevices gains a CDI entry and asserts it becomes --device=vendor.com/class=name.

Diff: 236 lines (+177 / -59) across 2 files Reviewer: AkihiroSuda Review duration: 4134m
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
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37.2% (MEDIUM) · Higher = larger blast radius
37.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.7% · Safe to merge
14.7%