-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from oarribas/master
OTA-1177: Gather OSUS data
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |