Skip to content

Commit 00347b7

Browse files
committed
Add check for unsupported config versions
Signed-off-by: Derek McGowan <[email protected]>
1 parent 8303183 commit 00347b7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

services/server/config/config.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,16 @@ func (c *Config) GetVersion() int {
9999
func (c *Config) ValidateV2() error {
100100
version := c.GetVersion()
101101
if version < 2 {
102-
logrus.Warnf("containerd config version `%d` has been deprecated and will be removed in containerd v2.0, please switch to version `2`, "+
103-
"see https://github.com/containerd/containerd/blob/main/docs/PLUGINS.md#version-header", version)
102+
logrus.Warnf("containerd config version `%d` has been deprecated and will be converted on each startup in containerd v2.0, "+
103+
"use `containerd config migrate` after upgrading to containerd 2.0 to avoid conversion on startup", version)
104104
return nil
105105
}
106+
if version > 2 {
107+
logrus.Errorf("containerd config version `%d` is not supported, the max version is `2`, "+
108+
"use `containerd config default` to generate a new config or manually revert to version `2`", version)
109+
return fmt.Errorf("unsupported config version `%d`", version)
110+
111+
}
106112
for _, p := range c.DisabledPlugins {
107113
if !strings.HasPrefix(p, "io.containerd.") || len(strings.SplitN(p, ".", 4)) < 4 {
108114
return fmt.Errorf("invalid disabled plugin URI %q expect io.containerd.x.vx", p)

0 commit comments

Comments
 (0)