From f45b2d9cc6f5fd7de0422d855a86cce01464a876 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 16 Aug 2019 08:41:52 -0500 Subject: [PATCH] cgroups: quote some paths on errors. Some errors propagate with printing showing a cgroup path. If for some reason this is empty is difficult to know looking at the logs. Signed-off-by: Jose Carlos Venegas Munoz --- virtcontainers/container.go | 4 ++-- virtcontainers/sandbox.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/virtcontainers/container.go b/virtcontainers/container.go index c53f5ee471..c7da8abfdc 100644 --- a/virtcontainers/container.go +++ b/virtcontainers/container.go @@ -1498,7 +1498,7 @@ func (c *Container) cgroupsDelete() error { } if err := cgroup.Delete(); err != nil { - return fmt.Errorf("Could not delete container cgroup %v: %v", c.state.CgroupPath, err) + return fmt.Errorf("Could not delete container cgroup path='%v': error='%v'", c.state.CgroupPath, err) } return nil @@ -1519,7 +1519,7 @@ func (c *Container) cgroupsUpdate(resources specs.LinuxResources) error { // update cgroup if err := cgroup.Update(&r); err != nil { - return fmt.Errorf("Could not update cgroup %v: %v", c.state.CgroupPath, err) + return fmt.Errorf("Could not update container cgroup path='%v': error='%v'", c.state.CgroupPath, err) } // store new resources diff --git a/virtcontainers/sandbox.go b/virtcontainers/sandbox.go index 5319a47aa7..a749f9ece2 100644 --- a/virtcontainers/sandbox.go +++ b/virtcontainers/sandbox.go @@ -1902,7 +1902,7 @@ func (s *Sandbox) cgroupsUpdate() error { } if err := cgroup.Update(&resources); err != nil { - return fmt.Errorf("Could not update cgroup %v: %v", s.state.CgroupPath, err) + return fmt.Errorf("Could not update sandbox cgroup path='%v' error='%v'", s.state.CgroupPath, err) } return nil