mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Make kernel detection work without suffix
This commit is contained in:
parent
16aeb77d51
commit
c05c91ca3b
2 changed files with 8 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
|||
package docker
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func getKernelVersion() (*KernelVersionInfo, error) {
|
||||
return nil, fmt.Errorf("Kernel version detection is not available on darwin")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package docker
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
@ -26,6 +27,9 @@ func getKernelVersion() (*KernelVersionInfo, error) {
|
|||
i++
|
||||
}
|
||||
|
||||
// Remove the \x00 from the release for Atoi to parse correctly
|
||||
release = release[:bytes.IndexByte(release, 0)]
|
||||
|
||||
tmp := strings.SplitN(string(release), "-", 2)
|
||||
tmp2 := strings.SplitN(tmp[0], ".", 3)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue