Skip to content

cri/server: use containerd/oci instead of libcontainer/devices (remove libcontainer/devices dependency)#5324

Merged
dmcgowan merged 1 commit intocontainerd:masterfrom
thaJeztah:no_libcontainer_devices
Apr 8, 2021
Merged

cri/server: use containerd/oci instead of libcontainer/devices (remove libcontainer/devices dependency)#5324
dmcgowan merged 1 commit intocontainerd:masterfrom
thaJeztah:no_libcontainer_devices

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Looks like we had our own copy of the "getDevices" code already, so use
that code (which also matches the code that's used to generate the spec,
so a better match).

Moving the code to a separate file, I also noticed that the _unix and _linux
code was exactly the same (baring some //nolint: comments), so also
removing the duplicated code.

With this patch applied, we removed the dependency on the libcontainer/devices
package (leaving only libcontainer/user).

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Apr 8, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

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

thaJeztah commented Apr 8, 2021

Oh; let me make 1 minor change; errNotADevice is duplicated now, and only used in utils_unix.go, so let me move it there;

var errNotADevice = errors.New("not a device node")

var errNotADevice = errors.New("not a device node")

Looks like we had our own copy of the "getDevices" code already, so use
that code (which also matches the code that's used to _generate_ the spec,
so a better match).

Moving the code to a separate file, I also noticed that the _unix and _linux
code was _exactly_ the same (baring some `//nolint:` comments), so also
removing the duplicated code.

With this patch applied, we removed the dependency on the libcontainer/devices
package (leaving only libcontainer/user).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the no_libcontainer_devices branch from cc67943 to 9bc8d63 Compare April 8, 2021 21:25
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Apr 8, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@dims dims left a comment

Choose a reason for hiding this comment

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

LGTM

Any dependency reduction is a win!

@thaJeztah
Copy link
Copy Markdown
Member Author

and it's ✅ 🎉 (which is always nice to see!)

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan merged commit 01a3926 into containerd:master Apr 8, 2021
@thaJeztah thaJeztah deleted the no_libcontainer_devices branch April 9, 2021 00:42
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.

4 participants