cmd/containerd: deduplicate config*.go
`config_linux.go` and `config_windows.go` are identical. `config_unsupported.go` is also almost identical but enables debug logs by default. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
9a7ca39cbd
commit
ac2726e12c
@ -22,6 +22,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/containerd/containerd/defaults"
|
||||
"github.com/containerd/containerd/pkg/timeout"
|
||||
"github.com/containerd/containerd/services/server"
|
||||
srvconfig "github.com/containerd/containerd/services/server/config"
|
||||
@ -113,3 +114,18 @@ var configCommand = cli.Command{
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func platformAgnosticDefaultConfig() *srvconfig.Config {
|
||||
return &srvconfig.Config{
|
||||
Version: 1,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: srvconfig.GRPCConfig{
|
||||
Address: defaults.DefaultAddress,
|
||||
MaxRecvMsgSize: defaults.DefaultMaxRecvMsgSize,
|
||||
MaxSendMsgSize: defaults.DefaultMaxSendMsgSize,
|
||||
},
|
||||
DisabledPlugins: []string{},
|
||||
RequiredPlugins: []string{},
|
||||
}
|
||||
}
|
||||
|
@ -17,21 +17,9 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/defaults"
|
||||
srvconfig "github.com/containerd/containerd/services/server/config"
|
||||
)
|
||||
|
||||
func defaultConfig() *srvconfig.Config {
|
||||
return &srvconfig.Config{
|
||||
Version: 1,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: srvconfig.GRPCConfig{
|
||||
Address: defaults.DefaultAddress,
|
||||
MaxRecvMsgSize: defaults.DefaultMaxRecvMsgSize,
|
||||
MaxSendMsgSize: defaults.DefaultMaxSendMsgSize,
|
||||
},
|
||||
DisabledPlugins: []string{},
|
||||
RequiredPlugins: []string{},
|
||||
}
|
||||
return platformAgnosticDefaultConfig()
|
||||
}
|
||||
|
@ -24,18 +24,10 @@ import (
|
||||
)
|
||||
|
||||
func defaultConfig() *srvconfig.Config {
|
||||
return &srvconfig.Config{
|
||||
Version: 1,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: srvconfig.GRPCConfig{
|
||||
Address: defaults.DefaultAddress,
|
||||
},
|
||||
Debug: srvconfig.Debug{
|
||||
Level: "info",
|
||||
Address: defaults.DefaultDebugAddress,
|
||||
},
|
||||
DisabledPlugins: []string{},
|
||||
RequiredPlugins: []string{},
|
||||
cfg := platformAgnosticDefaultConfig()
|
||||
cfg.Debug = srvconfig.Debug{
|
||||
Level: "info",
|
||||
Address: defaults.DefaultDebugAddress,
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
@ -17,21 +17,9 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/defaults"
|
||||
srvconfig "github.com/containerd/containerd/services/server/config"
|
||||
)
|
||||
|
||||
func defaultConfig() *srvconfig.Config {
|
||||
return &srvconfig.Config{
|
||||
Version: 1,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: srvconfig.GRPCConfig{
|
||||
Address: defaults.DefaultAddress,
|
||||
MaxRecvMsgSize: defaults.DefaultMaxRecvMsgSize,
|
||||
MaxSendMsgSize: defaults.DefaultMaxSendMsgSize,
|
||||
},
|
||||
DisabledPlugins: []string{},
|
||||
RequiredPlugins: []string{},
|
||||
}
|
||||
return platformAgnosticDefaultConfig()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user