Skip to content

Remove dependency on github.com/opencontainers/runtime-tools - #305

Merged
mikebrow merged 2 commits into
containerd:mainfrom
thaJeztah:rm_runtime_tools
Aug 14, 2026
Merged

mikebrow merged 2 commits into
containerd:mainfrom
thaJeztah:rm_runtime_tools

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

This copies the implementation that was added in containerd@e01c004 as an internal package, so that we can remove the dependency on the (largely unmaintained) runtime-tools module, including its dependencies.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This copies the implementation that was added in [containerd/nri@e01c004]
as an internal package, so that we can remove the dependency on the
(largely unmaintained) runtime-tools module, including its dependencies.

[containerd/nri@e01c004]: containerd/containerd@e01c004

Co-authored-by: Tianon Gravi <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the dependency on github.com/opencontainers/runtime-tools by copying the required OCI spec generator functionality into an internal package, and updating tests and module dependencies accordingly.

Changes:

  • Added an internal OCI spec generator implementation (pkg/runtime-tools/internal/ocigen) that satisfies pkg/runtime-tools/generate.UnderlyingGenerator.
  • Updated the pkg/runtime-tools/generate test suite to use the new internal generator instead of runtime-tools/generate.
  • Removed github.com/opencontainers/runtime-tools (and now-unneeded transitive deps) from go.mod/go.sum.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/runtime-tools/internal/ocigen/spec_generator.go New internal generator implementing the UnderlyingGenerator interface directly over *specs-go.Spec.
pkg/runtime-tools/generate/helpers_other.go Non-Linux stub signature adjusted while keeping behavior unchanged.
pkg/runtime-tools/generate/generate_suite_test.go Tests updated to use internal/ocigen instead of upstream runtime-tools/generate.
pkg/adaptation/plugin_other.go Non-Linux stub signature adjusted while keeping behavior unchanged.
go.mod Drops the github.com/opencontainers/runtime-tools requirement (and an indirect dep).
go.sum Removes checksums for now-unreferenced transitive dependencies.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thaJeztah
thaJeztah marked this pull request as ready for review August 12, 2026 00:55

@mikebrow mikebrow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

@thaJeztah

Copy link
Copy Markdown
Member Author

Thx!

@tianon (and "claude my eyes right out" 😂) did most of the work; I could sync back some of the changes to containerd; if we want the packages to be close (it was mostly exporting and some GoDoc added).

I kept it internal for now, to not couple containerd more, and the implementation is pretty straightforward, but it's something we could still consider if there's a strong need.

@klihub klihub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah

Copy link
Copy Markdown
Member Author

Oh! Somewhat unrelated question, but perhaps @klihub knows

I noticed this repo uses ginkgo / gomega in some of the packages; I know there's always polarizing opinions on it (some love it, others hate it). I mostly look at it from a dependency perspective (it tends to come with quite some).

I wonder if GinkGo was a deliberate choice for this module, or just something that organically found its way in through a contribution.

If there's no strong preference for GinkGo, then I have some branch on my machine that I can dust off that removes it 😅

@klihub

klihub commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Oh! Somewhat unrelated question, but perhaps @klihub knows

I noticed this repo uses ginkgo / gomega in some of the packages; I know there's always polarizing opinions on it (some love it, others hate it). I mostly look at it from a dependency perspective (it tends to come with quite some).

I wonder if GinkGo was a deliberate choice for this module, or just something that organically found its way in through a contribution.

It was a deliberate choice at the time, and a mistake I made, because I didn't know better. TBH (and wrt. your 'polarizing opinion' comment above), I've come to almost/mostly hate it (and with passion) ever since, so I'm now in that camp.

If there's no strong preference for GinkGo, then I have some branch on my machine that I can dust off that removes it 😅

@thaJeztah No, absolutely no strong preference for GinkGo. If you have a branch which reworks the unit tests to get rid of Ginko and gomega, it is more than welcomed as a PR.

@thaJeztah

Copy link
Copy Markdown
Member Author

Thanks! I can dust off that branch; probably can push it after this one's merged (I'm sure there'll be some conflicts with the go.mod files).

(and wrt. your 'polarizing opinion' comment above), I've come to almost/mostly hate it (and with passion) ever since

Yeah, I know some repositories that use it, but personally never really got into it. I can see parts that are nice (the code describes what you're testing), but it's very alien to stdlib testing, so always requires a context / mental switch for me.

The thing I'm not fond of is that "easy to read the test" comes along with a lot of abstraction, and I've seen examples where a It("should do something", Something()) was a lot of "something" that can easily hide flaws in the test ("looks pretty, but may not be testing what you think it is").

@mikebrow
mikebrow merged commit b3284f4 into containerd:main Aug 14, 2026
16 checks passed
@thaJeztah
thaJeztah deleted the rm_runtime_tools branch August 14, 2026 18:19
@samuelkarp

Copy link
Copy Markdown
Member

It was a deliberate choice at the time, and a mistake I made, because I didn't know better. TBH (and wrt. your 'polarizing opinion' comment above), I've come to almost/mostly hate it (and with passion) ever since, so I'm now in that camp.

We don't use it elsewhere in containerd. If you're okay with removing it, I think we should convert the tests over to use the standard test style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants