File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
2222 "os"
2323
2424 "github.com/BurntSushi/toml"
25+ "github.com/containerd/containerd/defaults"
2526 "github.com/containerd/containerd/pkg/timeout"
2627 "github.com/containerd/containerd/services/server"
2728 srvconfig "github.com/containerd/containerd/services/server/config"
@@ -113,3 +114,18 @@ var configCommand = cli.Command{
113114 },
114115 },
115116}
117+
118+ func platformAgnosticDefaultConfig () * srvconfig.Config {
119+ return & srvconfig.Config {
120+ Version : 1 ,
121+ Root : defaults .DefaultRootDir ,
122+ State : defaults .DefaultStateDir ,
123+ GRPC : srvconfig.GRPCConfig {
124+ Address : defaults .DefaultAddress ,
125+ MaxRecvMsgSize : defaults .DefaultMaxRecvMsgSize ,
126+ MaxSendMsgSize : defaults .DefaultMaxSendMsgSize ,
127+ },
128+ DisabledPlugins : []string {},
129+ RequiredPlugins : []string {},
130+ }
131+ }
Original file line number Diff line number Diff line change 1717package command
1818
1919import (
20- "github.com/containerd/containerd/defaults"
2120 srvconfig "github.com/containerd/containerd/services/server/config"
2221)
2322
2423func defaultConfig () * srvconfig.Config {
25- return & srvconfig.Config {
26- Version : 1 ,
27- Root : defaults .DefaultRootDir ,
28- State : defaults .DefaultStateDir ,
29- GRPC : srvconfig.GRPCConfig {
30- Address : defaults .DefaultAddress ,
31- MaxRecvMsgSize : defaults .DefaultMaxRecvMsgSize ,
32- MaxSendMsgSize : defaults .DefaultMaxSendMsgSize ,
33- },
34- DisabledPlugins : []string {},
35- RequiredPlugins : []string {},
36- }
24+ return platformAgnosticDefaultConfig ()
3725}
Original file line number Diff line number Diff line change @@ -24,18 +24,10 @@ import (
2424)
2525
2626func defaultConfig () * srvconfig.Config {
27- return & srvconfig.Config {
28- Version : 1 ,
29- Root : defaults .DefaultRootDir ,
30- State : defaults .DefaultStateDir ,
31- GRPC : srvconfig.GRPCConfig {
32- Address : defaults .DefaultAddress ,
33- },
34- Debug : srvconfig.Debug {
35- Level : "info" ,
36- Address : defaults .DefaultDebugAddress ,
37- },
38- DisabledPlugins : []string {},
39- RequiredPlugins : []string {},
27+ cfg := platformAgnosticDefaultConfig ()
28+ cfg .Debug = srvconfig.Debug {
29+ Level : "info" ,
30+ Address : defaults .DefaultDebugAddress ,
4031 }
32+ return cfg
4133}
Original file line number Diff line number Diff line change 1717package command
1818
1919import (
20- "github.com/containerd/containerd/defaults"
2120 srvconfig "github.com/containerd/containerd/services/server/config"
2221)
2322
2423func defaultConfig () * srvconfig.Config {
25- return & srvconfig.Config {
26- Version : 1 ,
27- Root : defaults .DefaultRootDir ,
28- State : defaults .DefaultStateDir ,
29- GRPC : srvconfig.GRPCConfig {
30- Address : defaults .DefaultAddress ,
31- MaxRecvMsgSize : defaults .DefaultMaxRecvMsgSize ,
32- MaxSendMsgSize : defaults .DefaultMaxSendMsgSize ,
33- },
34- DisabledPlugins : []string {},
35- RequiredPlugins : []string {},
36- }
24+ return platformAgnosticDefaultConfig ()
3725}
You can’t perform that action at this time.
0 commit comments