remote_daemon_options.go 837 B

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