bump(github.com/google/cadvisor): 27e1acbb4ef0fe1889208b21f8f4a6d0863e02f6
This commit is contained in:
19
vendor/github.com/google/cadvisor/container/common/helpers.go
generated
vendored
19
vendor/github.com/google/cadvisor/container/common/helpers.go
generated
vendored
@@ -127,15 +127,13 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF
|
||||
func readString(dirpath string, file string) string {
|
||||
cgroupFile := path.Join(dirpath, file)
|
||||
|
||||
// Ignore non-existent files
|
||||
if !utils.FileExists(cgroupFile) {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Read
|
||||
out, err := ioutil.ReadFile(cgroupFile)
|
||||
if err != nil {
|
||||
glog.Errorf("readString: Failed to read %q: %s", cgroupFile, err)
|
||||
// Ignore non-existent files
|
||||
if !os.IsNotExist(err) {
|
||||
glog.Errorf("readString: Failed to read %q: %s", cgroupFile, err)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(string(out))
|
||||
@@ -158,13 +156,12 @@ func readUInt64(dirpath string, file string) uint64 {
|
||||
|
||||
// Lists all directories under "path" and outputs the results as children of "parent".
|
||||
func ListDirectories(dirpath string, parent string, recursive bool, output map[string]struct{}) error {
|
||||
// Ignore if this hierarchy does not exist.
|
||||
if !utils.FileExists(dirpath) {
|
||||
return nil
|
||||
}
|
||||
|
||||
entries, err := ioutil.ReadDir(dirpath)
|
||||
if err != nil {
|
||||
// Ignore if this hierarchy does not exist.
|
||||
if os.IsNotExist(err) {
|
||||
err = nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
for _, entry := range entries {
|
||||
|
Reference in New Issue
Block a user