mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-22 09:49:35 +00:00
kata-deploy-cc: Simplify the script
As containerd is the only supported container engine, let's simplify the script and, at the same time, make it clear that other container engines are not supported yet. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
1f610ea5cc
commit
f684d00d50
@ -204,11 +204,7 @@ function remove_artifacts() {
|
|||||||
function cleanup_cri_runtime() {
|
function cleanup_cri_runtime() {
|
||||||
cleanup_different_shims_base
|
cleanup_different_shims_base
|
||||||
|
|
||||||
case $1 in
|
|
||||||
containerd | k3s | k3s-agent | rke2-agent | rke2-server)
|
|
||||||
cleanup_containerd
|
cleanup_containerd
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,9 +219,7 @@ function reset_runtime() {
|
|||||||
kubectl label node "$NODE_NAME" katacontainers.io/kata-runtime-
|
kubectl label node "$NODE_NAME" katacontainers.io/kata-runtime-
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl restart "$1"
|
systemctl restart "$1"
|
||||||
if [ "$1" == "containerd" ]; then
|
|
||||||
systemctl restart kubelet
|
systemctl restart kubelet
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
@ -236,22 +230,14 @@ function main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
runtime=$(get_container_runtime)
|
runtime=$(get_container_runtime)
|
||||||
|
if [ "$runtime" != "containerd" ]; then
|
||||||
if [ "$runtime" == "k3s" ] || [ "$runtime" == "k3s-agent" ] || [ "$runtime" == "rke2-agent" ] || [ "$runtime" == "rke2-server" ]; then
|
die "$runtime is not supported for now"
|
||||||
containerd_conf_tmpl_file="${containerd_conf_file}.tmpl"
|
|
||||||
if [ ! -f "$containerd_conf_tmpl_file" ]; then
|
|
||||||
cp "$containerd_conf_file" "$containerd_conf_tmpl_file"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
containerd_conf_file="${containerd_conf_tmpl_file}"
|
|
||||||
containerd_conf_file_backup="${containerd_conf_file}.bak"
|
|
||||||
elif [ "$runtime" == "containerd" ]; then
|
|
||||||
# runtime == containerd
|
|
||||||
if [ ! -f "$containerd_conf_file" ] && [ -d $(dirname "$containerd_conf_file") ] && \
|
if [ ! -f "$containerd_conf_file" ] && [ -d $(dirname "$containerd_conf_file") ] && \
|
||||||
[ -x $(command -v containerd) ]; then
|
[ -x $(command -v containerd) ]; then
|
||||||
containerd config default > "$containerd_conf_file"
|
containerd config default > "$containerd_conf_file"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
action=${1:-}
|
action=${1:-}
|
||||||
if [ -z "$action" ]; then
|
if [ -z "$action" ]; then
|
||||||
@ -259,9 +245,6 @@ function main() {
|
|||||||
die "invalid arguments"
|
die "invalid arguments"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# only install / remove / update if we are dealing with containerd
|
|
||||||
if [[ "$runtime" =~ ^(containerd|k3s|k3s-agent|rke2-agent|rke2-server)$ ]]; then
|
|
||||||
|
|
||||||
case "$action" in
|
case "$action" in
|
||||||
install)
|
install)
|
||||||
install_artifacts
|
install_artifacts
|
||||||
@ -281,7 +264,6 @@ function main() {
|
|||||||
print_usage
|
print_usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
#It is assumed this script will be called as a daemonset. As a result, do
|
#It is assumed this script will be called as a daemonset. As a result, do
|
||||||
# not return, otherwise the daemon will restart and rexecute the script
|
# not return, otherwise the daemon will restart and rexecute the script
|
||||||
|
Loading…
Reference in New Issue
Block a user