Warn if OOM monitoring is not available
Instead of failing with an error
@@ -13,6 +13,7 @@ import (
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/runtime"
metrics "github.com/docker/go-metrics"
+ "github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
@@ -71,7 +72,12 @@ func (m *cgroupsMonitor) Monitor(c runtime.Task) error {
if err := m.collector.Add(info.ID, info.Namespace, cg); err != nil {
return err
}
- return m.oom.Add(info.ID, info.Namespace, cg, m.trigger)
+ err = m.oom.Add(info.ID, info.Namespace, cg, m.trigger)
+ if err == cgroups.ErrMemoryNotSupported {
+ logrus.WithError(err).Warn("OOM monitoring failed")
+ return nil
+ }
+ return err
}
func (m *cgroupsMonitor) Stop(c runtime.Task) error {
