Skip to content

Commit f471bb2

Browse files
committed
tasks: emit warning for runc v1 runtime
Signed-off-by: Samuel Karp <[email protected]>
1 parent 329e1d4 commit f471bb2

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

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
@@ -231,9 +231,6 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
231231
Options: m.Options,
232232
})
233233
}
234-
if container.Runtime.Name == plugin.RuntimeRuncV1 {
235-
log.G(ctx).Warnf("%q is deprecated since containerd v1.4, consider using %q", plugin.RuntimeRuncV1, plugin.RuntimeRuncV2)
236-
}
237234
l.emitRuntimeWarning(ctx, container.Runtime.Name)
238235
rtime, err := l.getRuntime(container.Runtime.Name)
239236
if err != nil {
@@ -269,6 +266,9 @@ func (l *local) emitRuntimeWarning(ctx context.Context, runtime string) {
269266
case plugin.RuntimeLinuxV1:
270267
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)
271268
l.warnings.Emit(ctx, deprecation.RuntimeV1)
269+
case plugin.RuntimeRuncV1:
270+
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)
271+
l.warnings.Emit(ctx, deprecation.RuntimeRuncV1)
272272
}
273273
}
274274
func (l *local) Start(ctx context.Context, r *api.StartRequest, _ ...grpc.CallOption) (*api.StartResponse, error) {

0 commit comments

Comments
 (0)