MCPcopy Create free account
hub / github.com/containers/common / DeleteByPathConn

Method DeleteByPathConn

pkg/cgroups/cgroups.go:537–561  ·  view source on GitHub ↗

DeleteByPathConn deletes the specified cgroup path using the specified dbus connection if needed.

(path string, conn *systemdDbus.Conn)

Source from the content-addressed store, hash-verified

535// DeleteByPathConn deletes the specified cgroup path using the specified
536// dbus connection if needed.
537func (c *CgroupControl) DeleteByPathConn(path string, conn *systemdDbus.Conn) error {
538 if c.systemd {
539 return systemdDestroyConn(path, conn)
540 }
541 if c.cgroup2 {
542 return rmDirRecursively(filepath.Join(cgroupRoot, c.path))
543 }
544 var lastError error
545 for _, h := range handlers {
546 if err := h.Destroy(c); err != nil {
547 lastError = err
548 }
549 }
550
551 for _, ctr := range c.additionalControllers {
552 if ctr.symlink {
553 continue
554 }
555 p := c.getCgroupv1Path(ctr.name)
556 if err := rmDirRecursively(p); err != nil {
557 lastError = errors.Wrapf(err, "remove %s", p)
558 }
559 }
560 return lastError
561}
562
563// DeleteByPath deletes the specified cgroup path
564func (c *CgroupControl) DeleteByPath(path string) error {

Callers 1

DeleteByPathMethod · 0.95

Calls 4

getCgroupv1PathMethod · 0.95
systemdDestroyConnFunction · 0.85
rmDirRecursivelyFunction · 0.70
DestroyMethod · 0.65

Tested by

no test coverage detected