mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-19 12:14:11 +00:00
utils: informed pre-check about only_kata
passed the only_kata variable through to pre_check, only_kata does not abort the install when containerd is already installed. fixes #6385 Signed-off-by: Gabe Venberg <gabevenberg@gmail.com>
This commit is contained in:
parent
96252db787
commit
59c81ed2bb
@ -254,9 +254,14 @@ pre_checks()
|
|||||||
{
|
{
|
||||||
info "Running pre-checks"
|
info "Running pre-checks"
|
||||||
|
|
||||||
|
local only_kata="${1:-}"
|
||||||
|
[ -z "$only_kata" ] && die "no only_kata value"
|
||||||
|
|
||||||
command -v "${kata_shim_v2}" &>/dev/null \
|
command -v "${kata_shim_v2}" &>/dev/null \
|
||||||
&& die "Please remove existing $kata_project installation"
|
&& die "Please remove existing $kata_project installation"
|
||||||
|
|
||||||
|
[only_kata = "false" ] && return 0
|
||||||
|
|
||||||
local ret
|
local ret
|
||||||
|
|
||||||
{ containerd_installed; ret=$?; } || true
|
{ containerd_installed; ret=$?; } || true
|
||||||
@ -315,6 +320,9 @@ setup()
|
|||||||
local force="${2:-}"
|
local force="${2:-}"
|
||||||
[ -z "$force" ] && die "no force value"
|
[ -z "$force" ] && die "no force value"
|
||||||
|
|
||||||
|
local only_kata="${3:-}"
|
||||||
|
[ -z "$only_kata" ] && die "no only_kata value"
|
||||||
|
|
||||||
[ "$cleanup" = "true" ] && trap cleanup EXIT
|
[ "$cleanup" = "true" ] && trap cleanup EXIT
|
||||||
|
|
||||||
source /etc/os-release || source /usr/lib/os-release
|
source /etc/os-release || source /usr/lib/os-release
|
||||||
@ -324,7 +332,7 @@ setup()
|
|||||||
|
|
||||||
[ "$force" = "true" ] && return 0
|
[ "$force" = "true" ] && return 0
|
||||||
|
|
||||||
pre_checks
|
pre_checks "$only_kata"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Download the requested version of the specified project.
|
# Download the requested version of the specified project.
|
||||||
@ -691,7 +699,7 @@ handle_installation()
|
|||||||
|
|
||||||
[ "$only_run_test" = "true" ] && test_installation && return 0
|
[ "$only_run_test" = "true" ] && test_installation && return 0
|
||||||
|
|
||||||
setup "$cleanup" "$force"
|
setup "$cleanup" "$force" "$only_kata"
|
||||||
|
|
||||||
handle_kata "$kata_version" "$enable_debug"
|
handle_kata "$kata_version" "$enable_debug"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user