Fix backword-compatibility issue of non-versioned config file
According to the doc about `config.toml` of containerd: ``` If no version number is specified inside the config file then it is assumed to be a version 1 config and parsed as such. ``` However, it's not true recently. This will break the backward-compatibility in some environment. This commit fixes this issue. Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
@@ -98,6 +98,7 @@ func (c *Config) ValidateV2() error {
|
||||
version := c.GetVersion()
|
||||
if version < 2 {
|
||||
logrus.Warnf("deprecated version : `%d`, please switch to version `2`", version)
|
||||
return nil
|
||||
}
|
||||
for _, p := range c.DisabledPlugins {
|
||||
if len(strings.Split(p, ".")) < 4 {
|
||||
|
||||
Reference in New Issue
Block a user