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 <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
Jose Carlos Venegas Munoz 2019-08-16 08:41:52 -05:00
parent 6fdbef4ff5
commit f45b2d9cc6
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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