mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-18 07:18:27 +00:00
Merge pull request #11093 from kimullaa/fix-err-when-containerd-conf-does-not-exist
kata-deploy: fix bug when config does not exist
This commit is contained in:
@@ -91,6 +91,10 @@ function host_systemctl() {
|
||||
nsenter --target 1 --mount systemctl "${@}"
|
||||
}
|
||||
|
||||
function host_exec() {
|
||||
nsenter --target 1 --mount bash -c "$*"
|
||||
}
|
||||
|
||||
function print_usage() {
|
||||
echo "Usage: $0 [install/cleanup/reset]"
|
||||
}
|
||||
@@ -876,9 +880,9 @@ function main() {
|
||||
mkdir -p $(dirname "$containerd_conf_file")
|
||||
touch "$containerd_conf_file"
|
||||
elif [[ "$runtime" == "containerd" ]]; then
|
||||
if [ ! -f "$containerd_conf_file" ] && [ -d $(dirname "$containerd_conf_file") ] && [ -x $(command -v containerd) ]; then
|
||||
containerd config default > "$containerd_conf_file"
|
||||
fi
|
||||
if [ ! -f "$containerd_conf_file" ] && [ -d $(dirname "$containerd_conf_file") ]; then
|
||||
host_exec containerd config default > "$containerd_conf_file"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $use_containerd_drop_in_conf_file = "true" ]; then
|
||||
|
Reference in New Issue
Block a user