mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-11 16:37:39 +00:00
fix: Container.cGroupPath() skip empty line to avoid false error logging
Signed-off-by: ttyS3 <ttys3.rust@gmail.com> [NO NEW TESTS NEEDED]
This commit is contained in:
parent
4cc2ce0898
commit
42e70a0c94
1 changed files with 4 additions and 0 deletions
|
|
@ -986,6 +986,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(":"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue