2019-01-12 04:58:27 +00:00
|
|
|
// +build linux
|
|
|
|
|
|
|
|
package fs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/opencontainers/runc/libcontainer/cgroups"
|
|
|
|
"github.com/opencontainers/runc/libcontainer/configs"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NameGroup struct {
|
|
|
|
GroupName string
|
|
|
|
Join bool
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *NameGroup) Name() string {
|
|
|
|
return s.GroupName
|
|
|
|
}
|
|
|
|
|
2020-08-10 17:43:49 +00:00
|
|
|
func (s *NameGroup) Apply(path string, d *cgroupData) error {
|
2019-01-12 04:58:27 +00:00
|
|
|
if s.Join {
|
|
|
|
// ignore errors if the named cgroup does not exist
|
2021-04-14 18:11:13 +00:00
|
|
|
_ = join(path, d.pid)
|
2019-01-12 04:58:27 +00:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-06-18 20:46:09 +00:00
|
|
|
func (s *NameGroup) Set(_ string, _ *configs.Resources) error {
|
2019-01-12 04:58:27 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *NameGroup) GetStats(path string, stats *cgroups.Stats) error {
|
|
|
|
return nil
|
|
|
|
}
|