kata-deploy: Fix CRI-O detection

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 <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-09-21 10:15:17 +02:00
parent ebaa4fa4c1
commit 358dc2f569

View File

@ -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