mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
2c682d5209
This fixes an issue where the containerd client is cached in a container object in libcontainerd and becomes stale after containerd is restarted. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
18 lines
450 B
Go
18 lines
450 B
Go
package libcontainerd // import "github.com/docker/docker/libcontainerd"
|
|
|
|
import "fmt"
|
|
|
|
// WithOOMScore defines the oom_score_adj to set for the containerd process.
|
|
func WithOOMScore(score int) RemoteOption {
|
|
return oomScore(score)
|
|
}
|
|
|
|
type oomScore int
|
|
|
|
func (o oomScore) Apply(r Remote) error {
|
|
if remote, ok := r.(*remote); ok {
|
|
remote.OOMScore = int(o)
|
|
return nil
|
|
}
|
|
return fmt.Errorf("WithOOMScore option not supported for this remote")
|
|
}
|