From bed0f3c801b92eae9021970e94f066b876b86873 Mon Sep 17 00:00:00 2001 From: Snir Sheriber Date: Wed, 12 Jan 2022 10:12:41 +0200 Subject: [PATCH] kata-deploy: validate conf file can be created As containerd doesn't exist at cleanup Fixes: #3429 Signed-off-by: Snir Sheriber --- tools/packaging/kata-deploy/scripts/kata-deploy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh index 0d0afcece7..30e607a106 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -268,7 +268,8 @@ function main() { containerd_conf_file_backup="${containerd_conf_file}.bak" else # runtime == containerd - if [ ! -f "$containerd_conf_file" ]; then + if [ ! -f "$containerd_conf_file" ] && [ -d $(dirname "$containerd_conf_file") ] && \ + [ -x $(command -v containerd) ]; then containerd config default > "$containerd_conf_file" fi fi