mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-26 11:13:40 +00:00
Merge pull request #6419 from gabevenberg/containerd-pre-check
make only_kata work without -f
This commit is contained in:
@@ -254,9 +254,14 @@ pre_checks()
|
|||||||
{
|
{
|
||||||
info "Running pre-checks"
|
info "Running pre-checks"
|
||||||
|
|
||||||
|
local skip_containerd="${1:-}"
|
||||||
|
[ -z "$skip_containerd" ] && die "no skip_containerd 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"
|
||||||
|
|
||||||
|
[skip_containerd = "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 skip_containerd="${3:-}"
|
||||||
|
[ -z "$skip_containerd" ] && die "no skip_containerd 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 "$skip_containerd"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Download the requested version of the specified project.
|
# Download the requested version of the specified project.
|
||||||
@@ -673,8 +681,8 @@ handle_installation()
|
|||||||
local force="${2:-}"
|
local force="${2:-}"
|
||||||
[ -z "$force" ] && die "no force value"
|
[ -z "$force" ] && die "no force value"
|
||||||
|
|
||||||
local only_kata="${3:-}"
|
local skip_containerd="${3:-}"
|
||||||
[ -z "$only_kata" ] && die "no only Kata value"
|
[ -z "$skip_containerd" ] && die "no only Kata value"
|
||||||
|
|
||||||
local enable_debug="${4:-}"
|
local enable_debug="${4:-}"
|
||||||
[ -z "$enable_debug" ] && die "no enable debug value"
|
[ -z "$enable_debug" ] && die "no enable debug value"
|
||||||
@@ -691,11 +699,11 @@ handle_installation()
|
|||||||
|
|
||||||
[ "$only_run_test" = "true" ] && test_installation && return 0
|
[ "$only_run_test" = "true" ] && test_installation && return 0
|
||||||
|
|
||||||
setup "$cleanup" "$force"
|
setup "$cleanup" "$force" "$skip_containerd"
|
||||||
|
|
||||||
handle_kata "$kata_version" "$enable_debug"
|
handle_kata "$kata_version" "$enable_debug"
|
||||||
|
|
||||||
[ "$only_kata" = "false" ] && \
|
[ "$skip_containerd" = "false" ] && \
|
||||||
handle_containerd \
|
handle_containerd \
|
||||||
"$containerd_version" \
|
"$containerd_version" \
|
||||||
"$force" \
|
"$force" \
|
||||||
@@ -703,7 +711,7 @@ handle_installation()
|
|||||||
|
|
||||||
[ "$disable_test" = "false" ] && test_installation
|
[ "$disable_test" = "false" ] && test_installation
|
||||||
|
|
||||||
if [ "$only_kata" = "true" ]
|
if [ "$skip_containerd" = "true" ]
|
||||||
then
|
then
|
||||||
info "$kata_project is now installed"
|
info "$kata_project is now installed"
|
||||||
else
|
else
|
||||||
@@ -717,7 +725,7 @@ handle_args()
|
|||||||
{
|
{
|
||||||
local cleanup="true"
|
local cleanup="true"
|
||||||
local force="false"
|
local force="false"
|
||||||
local only_kata="false"
|
local skip_containerd="false"
|
||||||
local disable_test="false"
|
local disable_test="false"
|
||||||
local only_run_test="false"
|
local only_run_test="false"
|
||||||
local enable_debug="false"
|
local enable_debug="false"
|
||||||
@@ -735,7 +743,7 @@ handle_args()
|
|||||||
f) force="true" ;;
|
f) force="true" ;;
|
||||||
h) usage; exit 0 ;;
|
h) usage; exit 0 ;;
|
||||||
k) kata_version="$OPTARG" ;;
|
k) kata_version="$OPTARG" ;;
|
||||||
o) only_kata="true" ;;
|
o) skip_containerd="true" ;;
|
||||||
r) cleanup="false" ;;
|
r) cleanup="false" ;;
|
||||||
t) disable_test="true" ;;
|
t) disable_test="true" ;;
|
||||||
T) only_run_test="true" ;;
|
T) only_run_test="true" ;;
|
||||||
@@ -750,7 +758,7 @@ handle_args()
|
|||||||
handle_installation \
|
handle_installation \
|
||||||
"$cleanup" \
|
"$cleanup" \
|
||||||
"$force" \
|
"$force" \
|
||||||
"$only_kata" \
|
"$skip_containerd" \
|
||||||
"$enable_debug" \
|
"$enable_debug" \
|
||||||
"$disable_test" \
|
"$disable_test" \
|
||||||
"$only_run_test" \
|
"$only_run_test" \
|
||||||
|
Reference in New Issue
Block a user