From d1d3c7cbdaee47e04554d4f6c65c2f843e1b07ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 21 Sep 2023 10:15:17 +0200 Subject: [PATCH] kata-deploy: Fix CRI-O detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some of the "k8s distros" allow using CRI-O in a non-official way, and if that's done we cannot simply assume they're on containerd, otherwise kata-deploy will simply not work. In order to avoid such issue, let's check for `cri-o` as the container engine as the first place and only proceed with the checks for the "k8s distros" after we rule out that CRI-O is not being used. Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 358dc2f5695e185df1a8fdaf44dc447438060efa) --- 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 5a19befea..9d60a7ad0 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -75,7 +75,9 @@ function get_container_runtime() { die "invalid node name" fi - if echo "$runtime" | grep -qE 'containerd.*-k3s'; then + if echo "$runtime" | grep -qE "cri-o"; then + echo "cri-o" + elif echo "$runtime" | grep -qE 'containerd.*-k3s'; then if host_systemctl is-active --quiet rke2-agent; then echo "rke2-agent" elif host_systemctl is-active --quiet rke2-server; then