tasks: emit warning for runc v1 runtime

Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit f471bb2b8e)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
This commit is contained in:
Samuel Karp committed 2023-12-04 23:47:03 -08:00
1 parent 7825689b4c
commit efefd3bf33
2 files changed
+6 -3

No files matched your search

+3
View File
@@ -37,6 +37,8 @@ const (
AUFSSnapshotter Warning = Prefix + "aufs-snapshotter"
// RuntimeV1 is a warning for the io.containerd.runtime.v1.linux runtime
RuntimeV1 Warning = Prefix + "runtime-v1"
// RuntimeRuncV1 is a warning for the io.containerd.runc.v1 runtime
RuntimeRuncV1 Warning = Prefix + "runtime-runc-v1"
)
var messages = map[Warning]string{
@@ -52,6 +54,7 @@ var messages = map[Warning]string{
CRIAPIV1Alpha2: "CRI API v1alpha2 is deprecated since containerd v1.7 and removed in containerd v2.0. Use CRI API v1 instead.",
AUFSSnapshotter: "The aufs snapshotter is deprecated since containerd v1.5 and removed in containerd v2.0. Use the overlay snapshotter instead.",
RuntimeV1: "The `io.containerd.runtime.v1.linux` runtime is deprecated since containerd v1.4 and removed in containerd v2.0. Use the `io.containerd.runc.v2` runtime instead.",
RuntimeRuncV1: "The `io.containerd.runc.v1` runtime is deprecated since containerd v1.4 and removed in containerd v2.0. Use the `io.containerd.runc.v2` runtime instead.",
}
// Valid checks whether a given Warning is valid
+3 -3
View File
@@ -219,9 +219,6 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
Options: m.Options,
})
}
if container.Runtime.Name == plugin.RuntimeRuncV1 {
log.G(ctx).Warnf("%q is deprecated since containerd v1.4, consider using %q", plugin.RuntimeRuncV1, plugin.RuntimeRuncV2)
}
l.emitRuntimeWarning(ctx, container.Runtime.Name)
rtime, err := l.getRuntime(container.Runtime.Name)
if err != nil {
@@ -257,6 +254,9 @@ func (l *local) emitRuntimeWarning(ctx context.Context, runtime string) {
case plugin.RuntimeLinuxV1:
log.G(ctx).Warnf("%q is deprecated since containerd v1.4 and will be removed in containerd v2.0, use %q instead", plugin.RuntimeLinuxV1, plugin.RuntimeRuncV2)
l.warnings.Emit(ctx, deprecation.RuntimeV1)
case plugin.RuntimeRuncV1:
log.G(ctx).Warnf("%q is deprecated since containerd v1.4 and will be removed in containerd v2.0, use %q instead", plugin.RuntimeRuncV1, plugin.RuntimeRuncV2)
l.warnings.Emit(ctx, deprecation.RuntimeRuncV1)
}
}
func (l *local) Start(ctx context.Context, r *api.StartRequest, _ ...grpc.CallOption) (*api.StartResponse, error) {