Skip to content

Commit efefd3b

Browse files
committed
tasks: emit warning for runc v1 runtime
Signed-off-by: Samuel Karp <samuelkarp@google.com> (cherry picked from commit f471bb2) Signed-off-by: Samuel Karp <samuelkarp@google.com>
1 parent 7825689 commit efefd3b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pkg/deprecation/deprecation.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const (
3737
AUFSSnapshotter Warning = Prefix + "aufs-snapshotter"
3838
// RuntimeV1 is a warning for the io.containerd.runtime.v1.linux runtime
3939
RuntimeV1 Warning = Prefix + "runtime-v1"
40+
// RuntimeRuncV1 is a warning for the io.containerd.runc.v1 runtime
41+
RuntimeRuncV1 Warning = Prefix + "runtime-runc-v1"
4042
)
4143

4244
var messages = map[Warning]string{
@@ -52,6 +54,7 @@ var messages = map[Warning]string{
5254
CRIAPIV1Alpha2: "CRI API v1alpha2 is deprecated since containerd v1.7 and removed in containerd v2.0. Use CRI API v1 instead.",
5355
AUFSSnapshotter: "The aufs snapshotter is deprecated since containerd v1.5 and removed in containerd v2.0. Use the overlay snapshotter instead.",
5456
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.",
57+
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.",
5558
}
5659

5760
// Valid checks whether a given Warning is valid

services/tasks/local.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
219219
Options: m.Options,
220220
})
221221
}
222-
if container.Runtime.Name == plugin.RuntimeRuncV1 {
223-
log.G(ctx).Warnf("%q is deprecated since containerd v1.4, consider using %q", plugin.RuntimeRuncV1, plugin.RuntimeRuncV2)
224-
}
225222
l.emitRuntimeWarning(ctx, container.Runtime.Name)
226223
rtime, err := l.getRuntime(container.Runtime.Name)
227224
if err != nil {
@@ -257,6 +254,9 @@ func (l *local) emitRuntimeWarning(ctx context.Context, runtime string) {
257254
case plugin.RuntimeLinuxV1:
258255
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)
259256
l.warnings.Emit(ctx, deprecation.RuntimeV1)
257+
case plugin.RuntimeRuncV1:
258+
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)
259+
l.warnings.Emit(ctx, deprecation.RuntimeRuncV1)
260260
}
261261
}
262262
func (l *local) Start(ctx context.Context, r *api.StartRequest, _ ...grpc.CallOption) (*api.StartResponse, error) {

0 commit comments

Comments
 (0)