name.go 712 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // +build linux
  2. package fs
  3. import (
  4. "github.com/opencontainers/runc/libcontainer/cgroups"
  5. "github.com/opencontainers/runc/libcontainer/configs"
  6. )
  7. type NameGroup struct {
  8. GroupName string
  9. Join bool
  10. }
  11. func (s *NameGroup) Name() string {
  12. return s.GroupName
  13. }
  14. func (s *NameGroup) Apply(d *cgroupData) error {
  15. if s.Join {
  16. // ignore errors if the named cgroup does not exist
  17. d.join(s.GroupName)
  18. }
  19. return nil
  20. }
  21. func (s *NameGroup) Set(path string, cgroup *configs.Cgroup) error {
  22. return nil
  23. }
  24. func (s *NameGroup) Remove(d *cgroupData) error {
  25. if s.Join {
  26. removePath(d.path(s.GroupName))
  27. }
  28. return nil
  29. }
  30. func (s *NameGroup) GetStats(path string, stats *cgroups.Stats) error {
  31. return nil
  32. }