MCPcopy Index your code
hub / github.com/containerd/containerd / getKernelVersion

Function getKernelVersion

pkg/kernelversion/kernel_linux.go:53–63  ·  view source on GitHub ↗

getKernelVersion gets the current kernel version.

()

Source from the content-addressed store, hash-verified

51
52// getKernelVersion gets the current kernel version.
53func getKernelVersion() (*KernelVersion, error) {
54 once.Do(func() {
55 var uts unix.Utsname
56 if err := unix.Uname(&uts); err != nil {
57 return
58 }
59 // Remove the \x00 from the release for Atoi to parse correctly
60 currentKernelVersion, kernelVersionError = parseRelease(string(uts.Release[:bytes.IndexByte(uts.Release[:], 0)]))
61 })
62 return currentKernelVersion, kernelVersionError
63}
64
65// parseRelease parses a string and creates a KernelVersion based on it.
66func parseRelease(release string) (*KernelVersion, error) {

Callers 3

GreaterEqualThanFunction · 0.85
TestGetKernelVersionFunction · 0.85
TestGreaterEqualThanFunction · 0.85

Calls 2

parseReleaseFunction · 0.85
DoMethod · 0.80

Tested by 2

TestGetKernelVersionFunction · 0.68
TestGreaterEqualThanFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…