From 4f34a547771e91d6c29531381832aa74c7509562 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 19 Mar 2019 15:28:14 +0000 Subject: [PATCH 1/2] scripts: Refactor collect script Create a new function to collect all data display function calls in the data collection script. Signed-off-by: James O. D. Hunt --- data/kata-collect-data.sh.in | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/data/kata-collect-data.sh.in b/data/kata-collect-data.sh.in index 5e6ddc8953..48052db7ae 100644 --- a/data/kata-collect-data.sh.in +++ b/data/kata-collect-data.sh.in @@ -672,6 +672,19 @@ read_osbuilder_file() cat "$file" } +show_details() +{ + show_meta + show_runtime + show_runtime_configs + show_throttler_details + show_image_details + show_initrd_details + show_log_details + show_container_mgr_details + show_package_versions +} + main() { args=$(getopt \ @@ -711,15 +724,7 @@ main() [ $(id -u) -eq 0 ] || die "Need to run as root" [ -n "$runtime" ] || die "cannot find runtime '$runtime_name'" - show_meta - show_runtime - show_runtime_configs - show_throttler_details - show_image_details - show_initrd_details - show_log_details - show_container_mgr_details - show_package_versions + show_details } main "$@" From 5a271f06ce3fd3266a796ad80143ef1f47c73f43 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 19 Mar 2019 15:29:13 +0000 Subject: [PATCH 2/2] scripts: Allow data collection script output to be hidden Use a clever HTML trick to allow the output of the data collection script to be hidden / unhidden in the github.com interface. See the example at the top of https://github.com/kata-containers/runtime/issues/1347. Fixes #1386. Signed-off-by: James O. D. Hunt --- data/kata-collect-data.sh.in | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/data/kata-collect-data.sh.in b/data/kata-collect-data.sh.in index 48052db7ae..8d703f4433 100644 --- a/data/kata-collect-data.sh.in +++ b/data/kata-collect-data.sh.in @@ -672,8 +672,27 @@ read_osbuilder_file() cat "$file" } +show_header() +{ + cat < +Show $script_name details +

+EOT +} + +show_footer() +{ + cat < + +EOT +} + show_details() { + show_header + show_meta show_runtime show_runtime_configs @@ -683,6 +702,8 @@ show_details() show_log_details show_container_mgr_details show_package_versions + + show_footer } main()