From 839f6c3d4498067cb87b90beff7202726cbfc547 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Fri, 3 Nov 2023 11:48:15 +0000 Subject: [PATCH 1/2] utils: kata-manager: Improve info messages Improve some of the information messages a little by adding more detail and quoting file names. Signed-off-by: James O. D. Hunt --- utils/kata-manager.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index a70df88f18..93e8c3458d 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -501,7 +501,7 @@ configure_containerd() sudo grep -q "$kata_runtime_type" "$containerd_config" || { sudo cp "$containerd_config" "${original}" - info "Backed up $containerd_config to $original" + info "Backed up containerd config file '$containerd_config' to '$original'" } local modified="false" @@ -553,7 +553,7 @@ configure_containerd() modified="true" fi - [ "$modified" = "true" ] && info "Modified $containerd_config" + [ "$modified" = "true" ] && info "Modified containerd config file '$containerd_config'" sudo systemctl enable containerd sudo systemctl start containerd @@ -657,7 +657,7 @@ configure_kata() -e 's/^kernel_params = "\(.*\)"/kernel_params = "\1 agent.log=debug"/g' \ "$cfg_to" - info "Configured $kata_project for full debug (delete $cfg_to to use pristine $kata_project configuration)" + info "Configured $kata_project for full debug (delete '$cfg_to' to use pristine $kata_project configuration)" } handle_kata() From c72a27e21904f04cb7d473df400f947d08d8ef6b Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Fri, 3 Nov 2023 11:49:03 +0000 Subject: [PATCH 2/2] utils: kata-manager: Ensure only one download URL Add an extra sanity check to ensure that only a single download URL is found for the specified release version. Fixes: #8364. Signed-off-by: James O. D. Hunt --- utils/kata-manager.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index 93e8c3458d..7c460e8893 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -196,6 +196,15 @@ github_get_release_file_url() [ -z "$download_url" ] && die "Cannot determine download URL for version $version ($url)" + # Check to ensure there is only a single matching URL + local expected_count=1 + + local count + count=$(echo "$download_url" | wc -l) + + [ "$count" -eq "$expected_count" ] || \ + die "expected $expected_count download URL but found $download_url" + echo "$download_url" }