From f4d1e45c33ee3349176d92c6753871f36c3b58e2 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 15 Feb 2022 08:58:36 +0000 Subject: [PATCH] utils: Add kata-manager CLI options for kata and containerd Add options to `kata-manager.sh` to allow the version of Kata and containerd to be specified. Signed-off-by: James O. D. Hunt --- utils/kata-manager.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index 7330aece20..45c8448315 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -191,7 +191,9 @@ Description: Install $kata_project [1] and $containerd_project [2] from GitHub r Options: - -h : Show this help statement. + -c : Specify containerd version. + -h : Show this help statement. + -k : Specify Kata Containers version. Notes: @@ -562,17 +564,22 @@ handle_args() { local opt - while getopts "h" opt "$@" + local kata_version="" + local containerd_version="" + + while getopts "c:hk:" opt "$@" do case "$opt" in + c) containerd_version="$OPTARG" ;; h) usage; exit 0 ;; + k) kata_version="$OPTARG" ;; esac done shift $[$OPTIND-1] - local kata_version="${1:-}" - local containerd_version="${2:-}" + [ -z "$kata_version" ] && kata_version="${1:-}" || true + [ -z "$containerd_version" ] && containerd_version="${2:-}" || true handle_installation \ "$kata_version" \