Skip to content

Commit 4c789de

Browse files
committed
agent: Download and archive installation logs in gather.sh
Integrate the --download-logs mode into the artifact collection process. When running in ISO_NO_REGISTRY boot mode, gather.sh now: - Invokes the UI installer with --download-logs flag - Includes the downloaded installation-logs.tar in the screenshot archive if available The log download is best-effort and uses || true to ensure gather.sh continues successfully even if the download fails (e.g., if the UI is not accessible or logs are not yet available). Installation logs are now collected alongside screenshots in the agent-gather-console-screenshots.tar.xz archive, providing a complete set of console artifacts for debugging. Assisted-by: Claude Code
1 parent e51c1ba commit 4c789de

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

agent/gather.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -euxo pipefail
55
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
66

77
source "$SCRIPTDIR"/common.sh
8+
source "$SCRIPTDIR"/agent/common.sh
89

910
while read -r line
1011
do
@@ -28,6 +29,17 @@ if [[ "$num_screenshots" -gt 0 ]]; then
2829
archive_name="agent-gather-console-screenshots.tar.xz"
2930
echo "Gathering screenshots to $archive_name"
3031

32+
# Attempt to download installation logs from the UI
33+
if [[ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ]]; then
34+
echo "Attempting to download installation logs from Assisted Installer UI"
35+
rendezvousIP=$(getRendezvousIP)
36+
ocp_dir_abs_path="$(realpath "${OCP_DIR}")"
37+
38+
pushd agent/isobuilder/ui_driven_cluster_installation
39+
RENDEZVOUS_IP=$rendezvousIP OCP_DIR=$ocp_dir_abs_path go run main.go --download-logs || true
40+
popd
41+
fi
42+
3143
# Build list of files to archive
3244
files_to_archive=()
3345

@@ -39,6 +51,11 @@ if [[ "$num_screenshots" -gt 0 ]]; then
3951
files_to_archive+=("${OCP_DIR}"/*.png)
4052
fi
4153

54+
# Include installation logs if available
55+
if [[ -f "${OCP_DIR}/installation-logs.tar" ]]; then
56+
files_to_archive+=("${OCP_DIR}/installation-logs.tar")
57+
fi
58+
4259
# Create archive with all collected files
4360
tar -cJf $archive_name "${files_to_archive[@]}"
4461
else

0 commit comments

Comments
 (0)