From b843b236e4b81899e22e2eb21aa33dc9159000bb Mon Sep 17 00:00:00 2001 From: Beraldo Leal Date: Thu, 15 Aug 2024 14:09:33 -0400 Subject: [PATCH] kata-deploy: improve kata-deploy script For the rare cases where containerd_conf_file does not exist, cp could fail and let the pod in Error state. Let's make it a little bit more robust. Signed-off-by: Beraldo Leal --- tools/packaging/kata-deploy/scripts/kata-deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh index 8768600682..9664a772a8 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -663,7 +663,7 @@ function main() { runtime="crio" elif [ "$runtime" == "k3s" ] || [ "$runtime" == "k3s-agent" ] || [ "$runtime" == "rke2-agent" ] || [ "$runtime" == "rke2-server" ]; then containerd_conf_tmpl_file="${containerd_conf_file}.tmpl" - if [ ! -f "$containerd_conf_tmpl_file" ]; then + if [ ! -f "$containerd_conf_tmpl_file" ] && [ -f "$containerd_conf_file" ]; then cp "$containerd_conf_file" "$containerd_conf_tmpl_file" fi