diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-15 09:29:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 09:29:33 -0400 |
commit | 6b517a7e9077330bfe81d84401aa856e2fab380c (patch) | |
tree | 4fa3a4731493e02201d356f2b77121834a7d8586 | |
parent | e2f51eeb0693eda026fa509a9decfbdd7e0b74a8 (diff) | |
parent | fc9868e2247d2eb651586bd4b3e9a4ece3562fa0 (diff) | |
download | podman-6b517a7e9077330bfe81d84401aa856e2fab380c.tar.gz podman-6b517a7e9077330bfe81d84401aa856e2fab380c.tar.bz2 podman-6b517a7e9077330bfe81d84401aa856e2fab380c.zip |
Merge pull request #10668 from zhangguanzhang/panic-cgroup
[NO TESTS NEEDED] Fixes panic condition in cgroups.getAvailableControllers
-rw-r--r-- | pkg/cgroups/cgroups.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go index 911edeb5b..9cb32a364 100644 --- a/pkg/cgroups/cgroups.go +++ b/pkg/cgroups/cgroups.go @@ -165,14 +165,13 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool) if _, found := exclude[name]; found { continue } - isSymLink := false fileInfo, err := os.Stat(cgroupRoot + "/" + name) if err != nil { - isSymLink = !fileInfo.IsDir() + continue } c := controller{ name: name, - symlink: isSymLink, + symlink: !fileInfo.IsDir(), } controllers = append(controllers, c) } |