Skip to content

Commit 6220dc1

Browse files
committed
cri: add warning for old form of systemd_cgroup
Signed-off-by: Samuel Karp <[email protected]>
1 parent 2206522 commit 6220dc1

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/cri/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
456456
if c.ContainerdConfig.Runtimes[c.ContainerdConfig.DefaultRuntimeName].Type != plugin.RuntimeLinuxV1 {
457457
return warnings, fmt.Errorf("`systemd_cgroup` only works for runtime %s", plugin.RuntimeLinuxV1)
458458
}
459+
warnings = append(warnings, deprecation.CRISystemdCgroupV1)
459460
log.G(ctx).Warning("`systemd_cgroup` is deprecated, please use runtime `options` instead")
460461
}
461462
if c.NoPivot {

pkg/cri/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func TestValidateConfig(t *testing.T) {
146146
},
147147
},
148148
},
149+
warnings: []deprecation.Warning{deprecation.CRISystemdCgroupV1},
149150
},
150151
"deprecated systemd_cgroup for v2 runtime": {
151152
config: &PluginConfig{

pkg/deprecation/deprecation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const (
2525
PullSchema1Image Warning = Prefix + "pull-schema-1-image"
2626
// GoPluginLibrary is a warning for the use of dynamic library Go plugins
2727
GoPluginLibrary Warning = Prefix + "go-plugin-library"
28+
// CRISystemdCgroupV1 is a warning for the `systemd_cgroup` property
29+
CRISystemdCgroupV1 Warning = Prefix + "cri-systemd-cgroup-v1"
2830
// CRIRegistryMirrors is a warning for the use of the `mirrors` property
2931
CRIRegistryMirrors Warning = Prefix + "cri-registry-mirrors"
3032
// CRIRegistryAuths is a warning for the use of the `auths` property
@@ -45,6 +47,8 @@ var messages = map[Warning]string{
4547
PullSchema1Image: "Schema 1 images are deprecated since containerd v1.7 and removed in containerd v2.0. " +
4648
`Since containerd v1.7.8, schema 1 images are identified by the "io.containerd.image/converted-docker-schema1" label.`,
4749
GoPluginLibrary: "Dynamically-linked Go plugins as containerd runtimes will be deprecated in containerd v2.0 and removed in containerd v2.1.",
50+
CRISystemdCgroupV1: "The `systemd_cgroup` property (old form) of `[plugins.\"io.containerd.grpc.v1.cri\"] is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
51+
"Use `SystemdCgroup` in [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options] options instead.",
4852
CRIRegistryMirrors: "The `mirrors` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0." +
4953
"Use `config_path` instead.",
5054
CRIRegistryAuths: "The `auths` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.3 and will be removed in containerd v2.0." +

0 commit comments

Comments
 (0)