Forward OS/Kernel version to checkpoint

Useful to prioritize ebpf testing

Also:
* Make treatment of kernel release and version consistent across Darwin/Linux
This commit is contained in:
Alfonso Acosta
2016-12-19 20:08:08 +00:00
parent e70f2b98c0
commit 06ff64d477
9 changed files with 48 additions and 26 deletions
+4 -4
View File
@@ -19,15 +19,15 @@ const kb = 1024
// Uname is swappable for mocking in tests.
var Uname = syscall.Uname
// GetKernelVersion returns the kernel version as reported by uname.
var GetKernelVersion = func() (string, error) {
// GetKernelReleaseAndVersion returns the kernel version as reported by uname.
var GetKernelReleaseAndVersion = func() (string, string, error) {
var utsname syscall.Utsname
if err := Uname(&utsname); err != nil {
return "unknown", err
return "unknown", "unknown", err
}
release := marshal.FromUtsname(utsname.Release)
version := marshal.FromUtsname(utsname.Version)
return fmt.Sprintf("%s %s", release, version), nil
return release, version, nil
}
// GetLoad returns the current load averages as metrics.