github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/engine/libcontainerd/supervisor/remote_daemon_options.go (about) 1 package supervisor // import "github.com/docker/docker/libcontainerd/supervisor" 2 3 // WithRemoteAddr sets the external containerd socket to connect to. 4 func WithRemoteAddr(addr string) DaemonOpt { 5 return func(r *remote) error { 6 r.GRPC.Address = addr 7 return nil 8 } 9 } 10 11 // WithRemoteAddrUser sets the uid and gid to create the RPC address with 12 func WithRemoteAddrUser(uid, gid int) DaemonOpt { 13 return func(r *remote) error { 14 r.GRPC.UID = uid 15 r.GRPC.GID = gid 16 return nil 17 } 18 } 19 20 // WithLogLevel defines which log level to starts containerd with. 21 // This only makes sense if WithStartDaemon() was set to true. 22 func WithLogLevel(lvl string) DaemonOpt { 23 return func(r *remote) error { 24 r.Debug.Level = lvl 25 return nil 26 } 27 } 28 29 // WithDebugAddress defines at which location the debug GRPC connection 30 // should be made 31 func WithDebugAddress(addr string) DaemonOpt { 32 return func(r *remote) error { 33 r.Debug.Address = addr 34 return nil 35 } 36 } 37 38 // WithMetricsAddress defines at which location the debug GRPC connection 39 // should be made 40 func WithMetricsAddress(addr string) DaemonOpt { 41 return func(r *remote) error { 42 r.Metrics.Address = addr 43 return nil 44 } 45 } 46 47 // WithPlugin allow configuring a containerd plugin 48 // configuration values passed needs to be quoted if quotes are needed in 49 // the toml format. 50 func WithPlugin(name string, conf interface{}) DaemonOpt { 51 return func(r *remote) error { 52 r.pluginConfs.Plugins[name] = conf 53 return nil 54 } 55 }