mirror of
https://github.com/containers/podman.git
synced 2025-06-29 06:57:13 +08:00
Fix panic condition in cgroups.getAvailableControllers
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
This commit is contained in:
@ -165,14 +165,13 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool)
|
|||||||
if _, found := exclude[name]; found {
|
if _, found := exclude[name]; found {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
isSymLink := false
|
|
||||||
fileInfo, err := os.Stat(cgroupRoot + "/" + name)
|
fileInfo, err := os.Stat(cgroupRoot + "/" + name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
isSymLink = !fileInfo.IsDir()
|
continue
|
||||||
}
|
}
|
||||||
c := controller{
|
c := controller{
|
||||||
name: name,
|
name: name,
|
||||||
symlink: isSymLink,
|
symlink: !fileInfo.IsDir(),
|
||||||
}
|
}
|
||||||
controllers = append(controllers, c)
|
controllers = append(controllers, c)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user