cgroup2: enable controllers automatically
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
8f870c233f
commit
b02e20f12e
@ -336,7 +336,14 @@ func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (*taskAPI.
|
|||||||
logrus.WithError(err).Error("add cg to OOM monitor")
|
logrus.WithError(err).Error("add cg to OOM monitor")
|
||||||
}
|
}
|
||||||
case *cgroupsv2.Manager:
|
case *cgroupsv2.Manager:
|
||||||
// TODO: enable controllers for statting
|
allControllers, err := cg.RootControllers()
|
||||||
|
if err != nil {
|
||||||
|
logrus.WithError(err).Error("failed to get root controllers")
|
||||||
|
} else {
|
||||||
|
if err := cg.ToggleControllers(allControllers, cgroupsv2.Enable); err != nil {
|
||||||
|
logrus.WithError(err).Errorf("failed to enable controllers (%v)", allControllers)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// OOM monitor is not implemented yet
|
// OOM monitor is not implemented yet
|
||||||
logrus.WithError(errdefs.ErrNotImplemented).Warn("add cg to OOM monitor")
|
logrus.WithError(errdefs.ErrNotImplemented).Warn("add cg to OOM monitor")
|
||||||
|
Loading…
Reference in New Issue
Block a user