fix ctr tasks kill does not remove cni network under windows

Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
This commit is contained in:
Iceber Gu 2022-12-23 14:51:45 +08:00
parent 6c8c427166
commit a2df12d1a3

View File

@ -131,6 +131,8 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
return nil, err return nil, err
} }
opts = append(opts, oci.WithWindowsNetworkNamespace(ns.GetPath())) opts = append(opts, oci.WithWindowsNetworkNamespace(ns.GetPath()))
cniMeta := &commands.NetworkMetaData{EnableCni: true}
cOpts = append(cOpts, containerd.WithContainerExtension(commands.CtrCniMetadataExtension, cniMeta))
} }
if context.Bool("isolated") { if context.Bool("isolated") {
opts = append(opts, oci.WithWindowsHyperV) opts = append(opts, oci.WithWindowsHyperV)