From c9e631dc0cc3903ac4945fc98b9ecb6c48855c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 20 Dec 2023 11:34:25 -0300 Subject: [PATCH] kata-deploy: Reapply "kata-deploy: Use tomlq to configure containerd" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ee5fa08a270467bf78a6382ac6376213b7f44ed8. This is perfectly fine to do as we narrwoed down the issue to be on the version of `jq` provided by alpine, and we've already updated it in the previous commit (in this very same series). Signed-off-by: Fabiano FidĂȘncio --- .../kata-deploy/scripts/kata-deploy.sh | 54 ++++++------------- 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh index 208b3c96ce..7ff1b54d8a 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -94,8 +94,8 @@ function get_container_runtime() { else echo "k3s" fi - # Note: we assumed you used a conventional k0s setup and k0s will generate a systemd entry k0scontroller.service and k0sworker.service respectively - # and it is impossible to run this script without a kubelet, so this k0s controller must also have worker mode enabled + # Note: we assumed you used a conventional k0s setup and k0s will generate a systemd entry k0scontroller.service and k0sworker.service respectively + # and it is impossible to run this script without a kubelet, so this k0s controller must also have worker mode enabled elif host_systemctl is-active --quiet k0scontroller; then echo "k0s-controller" elif host_systemctl is-active --quiet k0sworker; then @@ -344,48 +344,24 @@ 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_type="io.containerd.$runtime.v2" - local options_table="$runtime_table.options" - local config_path="$(get_kata_containers_config_path "${shim}")/$configuration.toml" - if grep -q "\[$runtime_table\]" $containerd_conf_file; then - echo "Configuration exists for $runtime_table, overwriting" - sed -i "/\[$runtime_table\]/,+1s#runtime_type.*#runtime_type = \"${runtime_type}\"#" $containerd_conf_file - else - cat <