From e2d08dcf430c7c745197742b319f8e0d6951f44d Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 14 May 2020 15:28:00 +0100 Subject: [PATCH] kata-deploy: detect v1 schema and use correct long form of cri CRI has a v2 schema that seems to be the default in a lot of containerd installations. It uses a "long" form for the plugin id in the TOML config file. Fixes #881 Signed-off-by: Dave Syer --- kata-deploy/scripts/kata-deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kata-deploy/scripts/kata-deploy.sh b/kata-deploy/scripts/kata-deploy.sh index c649d1d3ef..d1154b7970 100755 --- a/kata-deploy/scripts/kata-deploy.sh +++ b/kata-deploy/scripts/kata-deploy.sh @@ -151,7 +151,11 @@ function configure_containerd_runtime() { runtime+="-$1" configuration+="-$1" fi - local runtime_table="plugins.cri.containerd.runtimes.$runtime" + local pluginid=cri + if grep -q "version = 2\>" $containerd_conf_file; then + pluginid=\"io.containerd.grpc.v1.cri\" + fi + local runtime_table="plugins.${pluginid}.containerd.runtimes.$runtime" local runtime_type="io.containerd.$runtime.v2" local options_table="$runtime_table.options" local config_path="/opt/kata/share/defaults/kata-containers/$configuration.toml"