mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 22:43:05 +00:00
manager: Add options to change self test behaviour
Added new `kata-manager` options to control the self-test behaviour. By default, after installation the manager will run a test to ensure a Kata Containers container can be created. New options allow: - The self test to be disabled. - Only the self test to be run (no installation). These features allow changes to be made to the installed system before the self test is run. Fixes: #3851. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
d4d65bed38
commit
9576a7da5d
@ -214,6 +214,8 @@ Options:
|
|||||||
-k <version> : Specify Kata Containers version.
|
-k <version> : Specify Kata Containers version.
|
||||||
-o : Only install Kata Containers.
|
-o : Only install Kata Containers.
|
||||||
-r : Don't cleanup on failure (retain files).
|
-r : Don't cleanup on failure (retain files).
|
||||||
|
-t : Disable self test (don't try to create a container after install).
|
||||||
|
-T : Only run self test (do not install anything).
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
@ -697,9 +699,17 @@ handle_installation()
|
|||||||
local enable_debug="${4:-}"
|
local enable_debug="${4:-}"
|
||||||
[ -z "$enable_debug" ] && die "no enable debug value"
|
[ -z "$enable_debug" ] && die "no enable debug value"
|
||||||
|
|
||||||
|
local disable_test="${5:-}"
|
||||||
|
[ -z "$disable_test" ] && die "no disable test value"
|
||||||
|
|
||||||
|
local only_run_test="${6:-}"
|
||||||
|
[ -z "$only_run_test" ] && die "no only run test value"
|
||||||
|
|
||||||
# These params can be blank
|
# These params can be blank
|
||||||
local kata_version="${5:-}"
|
local kata_version="${7:-}"
|
||||||
local containerd_version="${6:-}"
|
local containerd_version="${8:-}"
|
||||||
|
|
||||||
|
[ "$only_run_test" = "true" ] && test_installation && return 0
|
||||||
|
|
||||||
setup "$cleanup" "$force"
|
setup "$cleanup" "$force"
|
||||||
|
|
||||||
@ -711,6 +721,8 @@ handle_installation()
|
|||||||
"$force" \
|
"$force" \
|
||||||
"$enable_debug"
|
"$enable_debug"
|
||||||
|
|
||||||
|
[ "$disable_test" = "false" ] && test_installation
|
||||||
|
|
||||||
if [ "$only_kata" = "true" ]
|
if [ "$only_kata" = "true" ]
|
||||||
then
|
then
|
||||||
info "$kata_project is now installed"
|
info "$kata_project is now installed"
|
||||||
@ -726,6 +738,8 @@ handle_args()
|
|||||||
local cleanup="true"
|
local cleanup="true"
|
||||||
local force="false"
|
local force="false"
|
||||||
local only_kata="false"
|
local only_kata="false"
|
||||||
|
local disable_test="false"
|
||||||
|
local only_run_test="false"
|
||||||
local enable_debug="false"
|
local enable_debug="false"
|
||||||
|
|
||||||
local opt
|
local opt
|
||||||
@ -733,7 +747,7 @@ handle_args()
|
|||||||
local kata_version=""
|
local kata_version=""
|
||||||
local containerd_version=""
|
local containerd_version=""
|
||||||
|
|
||||||
while getopts "c:dfhk:or" opt "$@"
|
while getopts "c:dfhk:ortT" opt "$@"
|
||||||
do
|
do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
c) containerd_version="$OPTARG" ;;
|
c) containerd_version="$OPTARG" ;;
|
||||||
@ -743,6 +757,8 @@ handle_args()
|
|||||||
k) kata_version="$OPTARG" ;;
|
k) kata_version="$OPTARG" ;;
|
||||||
o) only_kata="true" ;;
|
o) only_kata="true" ;;
|
||||||
r) cleanup="false" ;;
|
r) cleanup="false" ;;
|
||||||
|
t) disable_test="true" ;;
|
||||||
|
T) only_run_test="true" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -756,6 +772,8 @@ handle_args()
|
|||||||
"$force" \
|
"$force" \
|
||||||
"$only_kata" \
|
"$only_kata" \
|
||||||
"$enable_debug" \
|
"$enable_debug" \
|
||||||
|
"$disable_test" \
|
||||||
|
"$only_run_test" \
|
||||||
"$kata_version" \
|
"$kata_version" \
|
||||||
"$containerd_version"
|
"$containerd_version"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user