Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.16] OCPBUGS-42960: Gather OSUS data #455

Open
wants to merge 1 commit into
base: release-4.16
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions collection-scripts/gather
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,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