diff --git a/data/cc-collect-data.sh.in b/data/cc-collect-data.sh.in index 855d7ccd..cf74ab73 100755 --- a/data/cc-collect-data.sh.in +++ b/data/cc-collect-data.sh.in @@ -41,6 +41,17 @@ heading() echo -e "\n# $name\n" } +subheading() +{ + local name="$*" + echo -e "\n## $name\n" +} + +separator() +{ + echo -e '\n---\n' +} + have_cmd() { local cmd="$1" @@ -87,7 +98,8 @@ show_runtime_configs() die "failed to check config files - runtime is probably too old ($version)" fi - msg "Runtime default config files" + subheading "Runtime default config files" + show_quoted_text "$configs" # add in the standard defaults for good measure "just in case" @@ -97,7 +109,7 @@ show_runtime_configs() # create a unique list of config files configs=$(echo $configs|tr ' ' '\n'|sort -u) - msg "Runtime config file contents" + subheading "Runtime config file contents" for config in $configs; do if [ -e "$config" ]; then @@ -106,6 +118,8 @@ show_runtime_configs() msg "Config file \`$config\` not found" fi done + + separator } show_runtime_log_details() @@ -146,11 +160,12 @@ show_runtime_log_details() else msg "Global log not enabled." fi + + separator } show_package_versions() { - heading "Packages" local pattern="(" @@ -182,6 +197,8 @@ show_package_versions() if have_cmd "rpm"; then run_cmd_and_show_quoted_output "rpm -qa|egrep \"$pattern\"" fi + + separator } show_container_mgr_details() @@ -189,12 +206,16 @@ show_container_mgr_details() heading "Container manager details" if have_cmd "docker"; then + subheading "Docker" run_cmd_and_show_quoted_output "docker info" fi if have_cmd "kubectl"; then + subheading "Kubernetes" run_cmd_and_show_quoted_output "kubectl config view" fi + + separator } show_meta() @@ -203,6 +224,8 @@ show_meta() date=$(date '+%Y-%m-%d.%H:%M:%S.%N') msg "Running \`$script_name\` version \`$script_version\` at \`$date\`." + + separator } show_runtime() @@ -212,6 +235,8 @@ show_runtime() cmd="cc-env" heading "\`$cmd\`" run_cmd_and_show_quoted_output "$runtime $cmd" + + separator } main()