-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new flag to collect minimal resources
Creating a flag to limit data collection to only major CRDs and CSVs, reducing time taken and log clutter. Signed-off-by: Sheetal Pamecha <[email protected]>
- Loading branch information
1 parent
9713e49
commit 0b5cc18
Showing
2 changed files
with
44 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,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Expect base collection path as an exported variable | ||
# If it is not defined, use PWD instead | ||
BASE_COLLECTION_PATH=${BASE_COLLECTION_PATH:-"$(pwd)"} | ||
|
||
MINIMAL_COLLECTION_PATH="${BASE_COLLECTION_PATH}/minimal_resources" | ||
|
||
# Create directories for minimal resources collection | ||
mkdir -p "${MINIMAL_COLLECTION_PATH}/oc_output" | ||
|
||
# Define minimal resources | ||
minimal_resources=() | ||
minimal_resources+=(cephclusters) | ||
minimal_resources+=(cephblockpools) | ||
minimal_resources+=(cephfilesystems) | ||
minimal_resources+=(csv) | ||
minimal_resources+=(sc) | ||
|
||
# Collect resources except for storageclusters | ||
for resource in "${minimal_resources[@]}"; do | ||
dbglog "collecting dump ${resource}" | ||
{ oc adm inspect --dest-dir="${MINIMAL_COLLECTION_PATH}" --all-namespaces ${LOG_FILTER_ARGS:+"${LOG_FILTER_ARGS}"} "${resource}" 2>&1; } | dbglog | ||
done | ||
|
||
# Special handling for storageclusters | ||
dbglog "Collecting storageclusters" | ||
{ oc get storageclusters --all-namespaces -o yaml; } > "${MINIMAL_COLLECTION_PATH}/oc_output/storageclusters.yaml" 2>&1 | ||
|
||
# Final message indicating completion | ||
dbglog "Minimal resources collection completed." |