From a2df12d1a374990606ef91c04ebd346a439d1e27 Mon Sep 17 00:00:00 2001 From: Iceber Gu Date: Fri, 23 Dec 2022 14:51:45 +0800 Subject: [PATCH] fix `ctr tasks kill` does not remove cni network under windows Signed-off-by: Iceber Gu --- cmd/ctr/commands/run/run_windows.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/ctr/commands/run/run_windows.go b/cmd/ctr/commands/run/run_windows.go index af97a0be3..d22bb2ead 100644 --- a/cmd/ctr/commands/run/run_windows.go +++ b/cmd/ctr/commands/run/run_windows.go @@ -131,6 +131,8 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli return nil, err } opts = append(opts, oci.WithWindowsNetworkNamespace(ns.GetPath())) + cniMeta := &commands.NetworkMetaData{EnableCni: true} + cOpts = append(cOpts, containerd.WithContainerExtension(commands.CtrCniMetadataExtension, cniMeta)) } if context.Bool("isolated") { opts = append(opts, oci.WithWindowsHyperV)