Fix backwards compat with v2 containerd configs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -50,6 +50,11 @@ var configCommand = cli.Command{
|
||||
config := &Config{
|
||||
Config: defaultConfig(),
|
||||
}
|
||||
// for the time being, keep the defaultConfig's version set at 1 so that
|
||||
// when a config without a version is loaded from disk and has no version
|
||||
// set, we assume it's a v1 config. But when generating new configs via
|
||||
// this command, generate the v2 config
|
||||
config.Config.Version = 2
|
||||
plugins, err := server.LoadPlugins(gocontext.Background(), config.Config)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
func defaultConfig() *srvconfig.Config {
|
||||
return &srvconfig.Config{
|
||||
Version: 2,
|
||||
Version: 1,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: srvconfig.GRPCConfig{
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
|
||||
func defaultConfig() *srvconfig.Config {
|
||||
return &srvconfig.Config{
|
||||
Version: 2,
|
||||
Version: 1,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: srvconfig.GRPCConfig{
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
func defaultConfig() *srvconfig.Config {
|
||||
return &srvconfig.Config{
|
||||
Version: 2,
|
||||
Version: 1,
|
||||
Root: defaults.DefaultRootDir,
|
||||
State: defaults.DefaultStateDir,
|
||||
GRPC: srvconfig.GRPCConfig{
|
||||
|
||||
Reference in New Issue
Block a user