Update to new cadvisor v0.48.1

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2023-10-31 07:51:09 -04:00
parent 0294521985
commit 8b9fc325e2
36 changed files with 425 additions and 331 deletions

View File

@@ -22,7 +22,6 @@ import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
@@ -42,6 +41,8 @@ const (
cpusListFileName = "cpus_list"
schemataFileName = "schemata"
tasksFileName = "tasks"
modeFileName = "mode"
sizeFileName = "size"
infoDirName = "info"
monDataDirName = "mon_data"
monGroupsDirName = "mon_groups"
@@ -72,6 +73,8 @@ var (
monGroupsDirName: {},
schemataFileName: {},
tasksFileName: {},
modeFileName: {},
sizeFileName: {},
}
)
@@ -189,7 +192,7 @@ func getPids(containerName string) ([]int, error) {
func getAllProcessThreads(path string) ([]int, error) {
processThreads := make([]int, 0)
threadDirs, err := ioutil.ReadDir(path)
threadDirs, err := os.ReadDir(path)
if err != nil {
return processThreads, err
}
@@ -216,7 +219,7 @@ func findGroup(group string, pids []string, includeGroup bool, exclusive bool) (
availablePaths = append(availablePaths, group)
}
files, err := ioutil.ReadDir(group)
files, err := os.ReadDir(group)
for _, file := range files {
if _, ok := groupDirectories[file.Name()]; !ok {
availablePaths = append(availablePaths, filepath.Join(group, file.Name()))
@@ -296,7 +299,7 @@ func readTasksFile(tasksPath string) (map[string]struct{}, error) {
}
func readStatFrom(path string, vendorID string) (uint64, error) {
context, err := ioutil.ReadFile(path)
context, err := os.ReadFile(path)
if err != nil {
return 0, err
}