containers / storage

Container Storage Library
Apache License 2.0
539 stars 234 forks source link

pkg/parsers/kernel: simplify #1889

Closed kolyshkin closed 2 months ago

kolyshkin commented 2 months ago

Since golang.org/x/sys/unix provides portable way to use uname(2) syscall, let's use it for all unix variants, removing the duplicated code from uname_*.go.

While at it:

NOTE this also removes the public definition of struct Utsname. I am puzzled as to why it was exported as it is not (and was not) used by any public functions in this package, nor I was able to find any usage of kernel.Utsname (using sourcegraph).

rhatdan commented 2 months ago

LGTM /approve @giuseppe @nalind @mtrmac @saschagrunert PTAL

kolyshkin commented 2 months ago

Simplifying the Unix implementation, sure.

WRT removing the public Utsname symbol, c/storage is supposed to have a stable API, but with things like #1622 (and many others), that’s… not been consistently the case.

As I was not able to find any existing users of kernel.Utsname, this API breakage seems purely theoretical.

openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, kolyshkin, rhatdan, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/containers/storage/blob/main/OWNERS)~~ [giuseppe,rhatdan,saschagrunert] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment