Skip to content

Commit

Permalink
Merge pull request #416 from oarribas/master
Browse files Browse the repository at this point in the history
OTA-1177: Gather OSUS data
  • Loading branch information
openshift-merge-bot[bot] authored Sep 18, 2024
2 parents f45d7c7 + 7b26112 commit ab95e6a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions collection-scripts/gather
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ pids+=($!)
/usr/bin/gather_ppc &
pids+=($!)

# Gather OSUS information
/usr/bin/gather_osus &
pids+=($!)

# Check if PID array has any values, if so, wait for them to finish
if [ ${#pids[@]} -ne 0 ]; then
echo "Waiting on subprocesses to finish execution."
Expand Down
26 changes: 26 additions & 0 deletions collection-scripts/gather_osus
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

source $(dirname "$0")/common.sh
BASE_COLLECTION_PATH="must-gather"
OSUS_OPERATOR_NAME="update-service-operator"
get_log_collection_args

HAS_OSUS=$(oc get csv -A --no-headers -o custom-columns=NS:.metadata.namespace,OPERATOR:.metadata.name --ignore-not-found=true | awk '/'${OSUS_OPERATOR_NAME}'/ {print $1}')
if [ -z "$HAS_OSUS" ]; then
exit 0
fi

function gather_osus() {
echo "INFO: Collecting OSUS Data"
declare -a OSUS_NAMESPACES=(${HAS_OSUS})

for OSUS_NAMESPACE in "${OSUS_NAMESPACES[@]}"; do
oc adm inspect ${log_collection_args} --dest-dir "${BASE_COLLECTION_PATH}" "ns/${OSUS_NAMESPACE}"
oc adm inspect --dest-dir "${BASE_COLLECTION_PATH}" updateservices --namespace "${OSUS_NAMESPACE}"
done
}

gather_osus

# force disk flush to ensure that all data gathered are written
sync

0 comments on commit ab95e6a

Please sign in to comment.