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 <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2022-02-15 08:58:36 +00:00
parent 3f87835a0e
commit f4d1e45c33

View File

@ -191,7 +191,9 @@ Description: Install $kata_project [1] and $containerd_project [2] from GitHub r
Options: Options:
-c <version> : Specify containerd version.
-h : Show this help statement. -h : Show this help statement.
-k <version> : Specify Kata Containers version.
Notes: Notes:
@ -562,17 +564,22 @@ handle_args()
{ {
local opt local opt
while getopts "h" opt "$@" local kata_version=""
local containerd_version=""
while getopts "c:hk:" opt "$@"
do do
case "$opt" in case "$opt" in
c) containerd_version="$OPTARG" ;;
h) usage; exit 0 ;; h) usage; exit 0 ;;
k) kata_version="$OPTARG" ;;
esac esac
done done
shift $[$OPTIND-1] shift $[$OPTIND-1]
local kata_version="${1:-}" [ -z "$kata_version" ] && kata_version="${1:-}" || true
local containerd_version="${2:-}" [ -z "$containerd_version" ] && containerd_version="${2:-}" || true
handle_installation \ handle_installation \
"$kata_version" \ "$kata_version" \