Update cAdvisor.
Also update golang.org/x/sys because of google/cadvisor#1786
This commit is contained in:
1
vendor/github.com/google/cadvisor/machine/BUILD
generated
vendored
1
vendor/github.com/google/cadvisor/machine/BUILD
generated
vendored
@@ -16,6 +16,7 @@ go_library(
|
||||
"//vendor/github.com/google/cadvisor/utils/cloudinfo:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/utils/sysfs:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/utils/sysinfo:go_default_library",
|
||||
"//vendor/golang.org/x/sys/unix:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
17
vendor/github.com/google/cadvisor/machine/info.go
generated
vendored
17
vendor/github.com/google/cadvisor/machine/info.go
generated
vendored
@@ -22,7 +22,6 @@ import (
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/google/cadvisor/fs"
|
||||
info "github.com/google/cadvisor/info/v1"
|
||||
@@ -31,6 +30,8 @@ import (
|
||||
"github.com/google/cadvisor/utils/sysinfo"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const hugepagesDirectory = "/sys/kernel/mm/hugepages/"
|
||||
@@ -189,19 +190,11 @@ func ContainerOsVersion() string {
|
||||
}
|
||||
|
||||
func KernelVersion() string {
|
||||
uname := &syscall.Utsname{}
|
||||
uname := &unix.Utsname{}
|
||||
|
||||
if err := syscall.Uname(uname); err != nil {
|
||||
if err := unix.Uname(uname); err != nil {
|
||||
return "Unknown"
|
||||
}
|
||||
|
||||
release := make([]byte, len(uname.Release))
|
||||
i := 0
|
||||
for _, c := range uname.Release {
|
||||
release[i] = byte(c)
|
||||
i++
|
||||
}
|
||||
release = release[:bytes.IndexByte(release, 0)]
|
||||
|
||||
return string(release)
|
||||
return string(uname.Release[:bytes.IndexByte(uname.Release[:], 0)])
|
||||
}
|
||||
|
14
vendor/github.com/google/cadvisor/machine/machine.go
generated
vendored
14
vendor/github.com/google/cadvisor/machine/machine.go
generated
vendored
@@ -24,7 +24,6 @@ import (
|
||||
|
||||
// s390/s390x changes
|
||||
"runtime"
|
||||
"syscall"
|
||||
|
||||
info "github.com/google/cadvisor/info/v1"
|
||||
"github.com/google/cadvisor/utils"
|
||||
@@ -32,6 +31,8 @@ import (
|
||||
"github.com/google/cadvisor/utils/sysinfo"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -265,18 +266,13 @@ func addNode(nodes *[]info.Node, id int) (int, error) {
|
||||
|
||||
// s390/s390x changes
|
||||
func getMachineArch() (string, error) {
|
||||
uname := syscall.Utsname{}
|
||||
err := syscall.Uname(&uname)
|
||||
uname := unix.Utsname{}
|
||||
err := unix.Uname(&uname)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var arch string
|
||||
for _, val := range uname.Machine {
|
||||
arch += string(int(val))
|
||||
}
|
||||
|
||||
return arch, nil
|
||||
return string(uname.Machine[:]), nil
|
||||
}
|
||||
|
||||
// arm32 chanes
|
||||
|
Reference in New Issue
Block a user