From 951700854cf3ca1490e0ad548fd3ecb7b189e0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 31 Jan 2024 15:24:43 +0100 Subject: [PATCH] misc: Detect k0s and error out if used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Differently than `k3s` or `rke2`, getting `k0s` to work as expected is quite tricky, as it relies on a drop-in configuration file, and I'm not so confident we can easily drop-in a file with all the needed bits. With this in mind, at least for now, let's just error out in case k0s is used, as at least this will make sure that the users will at least have a clue on what's been gone wrong. Signed-off-by: Fabiano FidĂȘncio --- misc/snapshotter/snapshotter.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/snapshotter/snapshotter.sh b/misc/snapshotter/snapshotter.sh index 740aa81358..6c46c2ebec 100644 --- a/misc/snapshotter/snapshotter.sh +++ b/misc/snapshotter/snapshotter.sh @@ -235,6 +235,10 @@ function get_container_runtime() { else echo "k3s" fi + elif nsenter -t 1 -m systemctl is-active --quiet k0scontroller; then + echo "k0s-controller" + elif nsenter -t 1 -m systemctl is-active --quiet k0sworker; then + echo "k0s-worker" else echo "$runtime" | awk -F '[:]' '{print $1}' fi