From 28b1e0dfe4a3b600fbc2f2cbbbc5c3e2fad72b12 Mon Sep 17 00:00:00 2001 From: Maciej Golaszewski Date: Tue, 26 Nov 2024 11:24:43 +0100 Subject: [PATCH] Add /etc/environment to inspection report Adding etc/environment to inspection report will help check proxy settings while solving deployment problems KU-2197 --- k8s/scripts/inspect.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/k8s/scripts/inspect.sh b/k8s/scripts/inspect.sh index 9f559451c..289f2110b 100755 --- a/k8s/scripts/inspect.sh +++ b/k8s/scripts/inspect.sh @@ -47,6 +47,11 @@ function is_service_active { systemctl status "snap.$service" | grep -q "active (running)" } +function collect_environment { + log_info "Copy environment file to the final report tarball" + cp -r --no-preserve=mode,ownership /etc/environment "$INSPECT_DUMP" +} + function collect_args { log_info "Copy service args to the final report tarball" cp -r --no-preserve=mode,ownership /var/snap/k8s/common/args "$INSPECT_DUMP" @@ -211,6 +216,9 @@ collect_k8s_diagnostics printf -- 'Collecting networking information\n' collect_network_diagnostics +printf -- 'Collecting environment information\n' +collect_environment + matches=$(grep -rlEi "BEGIN CERTIFICATE|PRIVATE KEY" inspection-report) if [ -n "$matches" ]; then matches_comma_separated=$(echo "$matches" | tr '\n' ',')