remote_daemon_options.go 896 B

1234567891011121314151617181920212223242526272829303132333435
  1. package supervisor // import "github.com/docker/docker/libcontainerd/supervisor"
  2. import (
  3. "github.com/containerd/log"
  4. )
  5. // WithLogLevel defines which log level to start containerd with.
  6. func WithLogLevel(lvl string) DaemonOpt {
  7. return func(r *remote) error {
  8. if lvl == "info" {
  9. // both dockerd and containerd default log-level is "info",
  10. // so don't pass the default.
  11. lvl = ""
  12. }
  13. r.logLevel = lvl
  14. return nil
  15. }
  16. }
  17. // WithLogFormat defines the containerd log format.
  18. // This only makes sense if WithStartDaemon() was set to true.
  19. func WithLogFormat(format log.OutputFormat) DaemonOpt {
  20. return func(r *remote) error {
  21. r.Debug.Format = string(format)
  22. return nil
  23. }
  24. }
  25. // WithCRIDisabled disables the CRI plugin.
  26. func WithCRIDisabled() DaemonOpt {
  27. return func(r *remote) error {
  28. r.DisabledPlugins = append(r.DisabledPlugins, "io.containerd.grpc.v1.cri")
  29. return nil
  30. }
  31. }