Skip to content

Commit

Permalink
must-gather: added echo logs in gather debug log file
Browse files Browse the repository at this point in the history
this pr fixes an issue where log message was echoed in the terminal output but not getting logged in the gather-debug.log file.

Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
  • Loading branch information
RAJAT SINGH committed Mar 24, 2021
1 parent b972f06 commit 2835b08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions must-gather/collection-scripts/gather_ceph_resources
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ for ns in $namespaces; do

# Collecting ceph prepare volume logs
volume_collection(){
printf "collecting prepare volume logs from node %s \n" "${node}"
printf "collecting prepare volume logs from node %s \n" "${node}" | tee -a "${BASE_COLLECTION_PATH}"/gather-debug.log
oc rsync -n "${ns}" "$(oc get pods -n "${ns}"| grep "${node//./}-debug"| awk '{print $1}')":/host/var/lib/rook/openshift-storage/log "${NODE_OUTPUT_DIR}"
}

crash_collection(){
printf "collecting crash core dump from node %s \n" "${node}"
printf "collecting crash core dump from node %s \n" "${node}" | tee -a "${BASE_COLLECTION_PATH}"/gather-debug.log
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" -l "${node//./}"-debug='ready' --no-headers | awk '{print $1}')":/host/var/lib/rook/openshift-storage/crash/ "${CRASH_OUTPUT_DIR}"
}

Expand All @@ -216,11 +216,11 @@ for ns in $namespaces; do

if [ -n "${pids[*]}" ]; then
# wait for all pids
echo "waiting for ${pids[*]} to terminate"
echo "waiting for ${pids[*]} to terminate" | tee -a "${BASE_COLLECTION_PATH}"/gather-debug.log
wait "${pids[@]}"
fi

echo "ceph core dump collection completed"
echo "ceph core dump collection completed" | tee -a "${BASE_COLLECTION_PATH}"/gather-debug.log
done

cat "${BASE_COLLECTION_PATH}"/gather-ceph-debug.log >> "${BASE_COLLECTION_PATH}"/gather-debug.log 2>&1
Expand Down

0 comments on commit 2835b08

Please sign in to comment.