remote_daemon_options_linux.go 450 B

123456789101112131415161718
  1. package libcontainerd // import "github.com/docker/docker/libcontainerd"
  2. import "fmt"
  3. // WithOOMScore defines the oom_score_adj to set for the containerd process.
  4. func WithOOMScore(score int) RemoteOption {
  5. return oomScore(score)
  6. }
  7. type oomScore int
  8. func (o oomScore) Apply(r Remote) error {
  9. if remote, ok := r.(*remote); ok {
  10. remote.OOMScore = int(o)
  11. return nil
  12. }
  13. return fmt.Errorf("WithOOMScore option not supported for this remote")
  14. }