Skip to content

Commit

Permalink
add check before collecting MCG dataase
Browse files Browse the repository at this point in the history
if noobaa pod is in pending state, we should not
collect the MCG database info as it get stucks.
This commit adds check to avoid this.

Signed-off-by: yati1998 <[email protected]>
  • Loading branch information
yati1998 committed Nov 29, 2023
1 parent cb8995c commit 597ed19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions collection-scripts/gather_noobaa_resources
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ mkdir -p "${NOOBAA_COLLLECTION_PATH}/raw_output/}"

# Save the information of all Postgres DBs in the NooBaa DB pod
dbglog "Collecting MCG database information..."
oc rsh --namespace openshift-storage noobaa-db-pg-0 psql -d nbcore -c '\pset pager off' -c '\x on' -c '\list+' &> "${NOOBAA_COLLLECTION_PATH}"/raw_output/db_list.txt 2>&1

pod_status=$(kubectl get po noobaa-db-pg-0 psql -nopenshift-storage -o jsonpath='{.items.status.phase}')
if [ "${pod_status}" == "Running" ]; then
oc rsh --namespace openshift-storage noobaa-db-pg-0 psql -d nbcore -c '\pset pager off' -c '\x on' -c '\list+' &> "${NOOBAA_COLLLECTION_PATH}"/raw_output/db_list.txt 2>&1
fi
# Run the Collection of Noobaa cli using must-gather
# shellcheck disable=SC2086
for cli in "${noobaa_cli[@]}"; do
Expand Down

0 comments on commit 597ed19

Please sign in to comment.