diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-10 03:43:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-10 03:43:34 -0400 |
commit | 28588235d2051bf673d528c293261f926fad0d92 (patch) | |
tree | 09bbed6343d99e42f356b0401a40660613e8bc34 | |
parent | 21c816bb169912bc98e77735ba7bece103c0d799 (diff) | |
parent | be5abf03ababc822ba5d035b7e6f629a9f200bd8 (diff) | |
download | podman-28588235d2051bf673d528c293261f926fad0d92.tar.gz podman-28588235d2051bf673d528c293261f926fad0d92.tar.bz2 podman-28588235d2051bf673d528c293261f926fad0d92.zip |
Merge pull request #14147 from ttys3/Container.cGroupPath-Error-parsing-cgroup
fix: Container.cGroupPath() skip empty line to avoid false error logging
-rw-r--r-- | libpod/container.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go index 4b2af02ab..d7af9a100 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -994,6 +994,10 @@ func (c *Container) cGroupPath() (string, error) { var cgroupPath string for _, line := range bytes.Split(lines, []byte("\n")) { + // skip last empty line + if len(line) == 0 { + continue + } // cgroups(7) nails it down to three fields with the 3rd // pointing to the cgroup's path which works both on v1 and v2. fields := bytes.Split(line, []byte(":")) |