Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions machine/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package machine

import (
"bytes"
"flag"
"os"
"path/filepath"
Expand Down Expand Up @@ -169,10 +168,8 @@ func ContainerOsVersion() string {

func KernelVersion() string {
uname := &unix.Utsname{}

if err := unix.Uname(uname); err != nil {
return "Unknown"
}

return string(uname.Release[:bytes.IndexByte(uname.Release[:], 0)])
return unix.ByteSliceToString(uname.Release[:])
}
2 changes: 1 addition & 1 deletion machine/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func getMachineArch() string {
klog.Errorf("Cannot get machine architecture, err: %v", err)
return ""
}
return string(uname.Machine[:])
return unix.ByteSliceToString(uname.Machine[:])
}

// arm32 changes
Expand Down
Loading