Repository navigation
Remove dependency on github.com/opencontainers/runtime-tools - #13519
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR removes the dependency on github.com/opencontainers/runtime-tools/generate by introducing an internal OCI spec generator implementation, and updates Go module/vendoring metadata accordingly (including a temporary CDI module replacement).
Changes:
- Added
internal/cri/nri/spec_generator.goimplementing the generator functionality directly on*specs-go.Spec. - Updated NRI API wiring to use the new internal generator instead of
runtime-tools/generate. - Updated
go.mod,go.sum, andvendor/modules.txtto dropruntime-toolsand apply a temporarycontainer-device-interfacemodule replacement.
Reviewed changes
Copilot reviewed 3 out of 31 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
internal/cri/nri/spec_generator.go |
New internal generator implementation to avoid importing runtime-tools/generate. |
internal/cri/nri/nri_api_linux.go |
Switches to the internal generator (newSpecGen) in the NRI adjust path. |
go.mod |
Removes runtime-tools and adds a temporary replace for CDI. |
go.sum |
Removes checksums for dropped deps and adds checksums for the replaced CDI fork module. |
vendor/modules.txt |
Reflects module removals and the CDI replacement in vendoring metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| replace github.com/containerd/containerd/api => ./api | ||
|
|
||
| replace tags.cncf.io/container-device-interface => github.com/tianon-sso/cncf-cdi v0.0.0-20260602195946-5a781dda2ce0 // TODO https://github.com/cncf-tags/container-device-interface/pull/316 |
There was a problem hiding this comment.
Yes, this is valid, and why the PR is still a draft -- I wouldn't suggest merging this with the replace rule in-place -- that just makes the full change visible (with the full removal of runtime-tools).
7f2fc92 to
f6588ae
Compare
|
|
||
| replace github.com/containerd/containerd/api => ./api | ||
|
|
||
| replace tags.cncf.io/container-device-interface => tags.cncf.io/container-device-interface v1.1.1-0.20260625135320-7a214f294075 // TODO https://github.com/cncf-tags/container-device-interface/pull/317 |
|
|
||
| replace github.com/containerd/containerd/api => ./api | ||
|
|
||
| replace tags.cncf.io/container-device-interface => tags.cncf.io/container-device-interface v1.1.1-0.20260625135320-7a214f294075 // TODO https://github.com/cncf-tags/container-device-interface/pull/317 |
There was a problem hiding this comment.
1.1.1-xxx is now higher than 1.1.0 so you can remove the replace and just update the version to a (not yet tagged) version @tianon
There was a problem hiding this comment.
Yeah I thought about it, but decided to leave it as replace because it felt wrong to put an untagged version above and I wanted it obvious that this is a bad state and we shouldn't leave it like this -- but I'm happy to update if that's the preference
There was a problem hiding this comment.
Seems like there's releases done nowadays with untagged dependency versions. so 🤷♂️😆
The direct use was two lines in `internal/cri/nri/nri_api_linux.go` -- constructing a `generate.Generator{Config: spec}` solely to satisfy the `nrigen.UnderlyingGenerator` interface defined in `containerd/nri`. Since that interface already exists, we just need an implementation. Add `spec_generator.go` in the same package, implementing `UnderlyingGenerator` directly on `*rspec.Spec` with no external dependencies beyond `runtime-spec`.
Assisted-By: "claude my eyes right out"
Signed-off-by: Tianon Gravi <[email protected]>
f6588ae to
e01c004
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 33 changed files in this pull request and generated no new comments.
Suppressed comments (1)
go.mod:93
- PR description mentions a temporary
replacedirective pointing at cncf-tags/container-device-interface@7a214f... to remove CDI's runtime-tools dependency, butgo.modcurrently has noreplacesection and instead pinstags.cncf.io/container-device-interfacedirectly to a pseudo-version. Please update the PR description to match the actual approach (or add the intendedreplaceif the pseudo-version is not sufficient).
k8s.io/klog/v2 v2.140.0
k8s.io/streaming v0.36.3
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5
tags.cncf.io/container-device-interface v1.1.1-0.20260720132747-49ac08dcf160
)
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM
(started reviewing, then forgot to LGTM 😂)
|
Looks like the merge queue was cancelled because of GitHub's outage Yesterday; can someone kick it again? |
The direct use was two lines in
internal/cri/nri/nri_api_linux.go-- constructing agenerate.Generator{Config: spec}solely to satisfy thenrigen.UnderlyingGeneratorinterface defined incontainerd/nri. Since that interface already exists, we just need an implementation. Addspec_generator.goin the same package, implementingUnderlyingGeneratordirectly on*rspec.Specwith no external dependencies beyondruntime-spec.The transitive dependency viatags.cncf.io/container-device-interfaceis addressed by the temporary replace directive pointing at cncf-tags/container-device-interface@7a214f2 (cncf-tags/container-device-interface#317), which removes that project's own use of runtime-tools. The replace will be dropped once that change is released.Assisted-By: "claude my eyes right out"