From f15d40f8fb7ffe9eaae10aa62d84d13e1a6d76cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 26 May 2024 19:46:30 +0200 Subject: [PATCH] kata-deploy: Fix k0s deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit k0s deployment has been broken since we moved to using `tomlq` in our scripts. The reason is that before using `tomlq` our script would, involuntarily, end up creating the file. Now, in order to fix the situation, we need to explicitly create the file and let `tomlq` add the needed content. Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/kata-deploy/scripts/kata-deploy.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh index 6c5f661b85..27be984a2c 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -459,12 +459,13 @@ function configure_containerd_runtime() { local runtime="kata-${shim}" local configuration="configuration-${shim}" local pluginid=cri - + # if we are running k0s auto containerd.toml generation, the base template is by default version 2 # we can safely assume to reference the newer version of cri if grep -q "version = 2\>" $containerd_conf_file || [ "$1" == "k0s-worker" ] || [ "$1" == "k0s-controller" ]; then pluginid=\"io.containerd.grpc.v1.cri\" fi + local runtime_table=".plugins.${pluginid}.containerd.runtimes.\"${runtime}\"" local runtime_options_table="${runtime_table}.options" local runtime_type=\"io.containerd."${runtime}".v2\" @@ -640,6 +641,7 @@ function main() { # This works by k0s creating a special directory in /etc/k0s/containerd.d/ where user can drop-in partial containerd configuration snippets. # k0s will automatically pick up these files and adds these in containerd configuration imports list. containerd_conf_file="/etc/containerd/kata-containers.toml" + touch "$containerd_conf_file" else # runtime == containerd if [ ! -f "$containerd_conf_file" ] && [ -d $(dirname "$containerd_conf_file") ] && \