Skip to content

Commit

Permalink
fix: add snapshot related commands in must-gather
Browse files Browse the repository at this point in the history
Add commands in must-gather to capture snapshot related
kubernetes objects.

Signed-off-by: Mudit Agarwal <[email protected]>
  • Loading branch information
agarwal-mudit committed Apr 8, 2022
1 parent 8d77b03 commit ae79034
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions must-gather/collection-scripts/gather_clusterscoped_resources
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ commands_get+=("infrastructures.config")
commands_get+=("clusterrole")
commands_get+=("clusterrolebinding")
commands_get+=("scc")
commands_get+=("volumesnapshotclass")
commands_get+=("volumesnapshotcontent")

# collect yaml output of OC commands
oc_yamls=()
Expand All @@ -35,6 +37,8 @@ oc_yamls+=("infrastructures.config")
oc_yamls+=("clusterrole")
oc_yamls+=("clusterrolebinding")
oc_yamls+=("scc")
oc_yamls+=("volumesnapshotclass")
oc_yamls+=("volumesnapshotcontent")


# collect describe output of OC commands
Expand All @@ -48,6 +52,8 @@ commands_desc+=("infrastructures.config")
commands_desc+=("clusterrole")
commands_desc+=("clusterrolebinding")
commands_desc+=("scc")
commands_desc+=("volumesnapshotclass")
commands_desc+=("volumesnapshotcontent")

# collection path for OC commands
mkdir -p "${BASE_COLLECTION_PATH}/cluster-scoped-resources/oc_output/"
Expand Down
9 changes: 6 additions & 3 deletions must-gather/collection-scripts/gather_namespaced_resources
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,11 @@ commands_desc+=("lvmvolumegroup")
commands_desc+=("lvmvolumegroupsnodestatus")
commands_desc+=("pods")



# collect yaml output of OC commands
oc_yamls=()
oc_yamls+=("csv")
oc_yamls+=("installplan")


echo "collecting dump of namespace" | tee -a "${BASE_COLLECTION_PATH}"/gather-debug.log
oc adm --dest-dir="${BASE_COLLECTION_PATH}" inspect ns/"${INSTALL_NAMESPACE}" --"${SINCE_TIME}" >> "${BASE_COLLECTION_PATH}"/gather-debug.log 2>&1
echo "collecting dump of clusterresourceversion" | tee -a "${BASE_COLLECTION_PATH}"/gather-debug.log
Expand Down Expand Up @@ -102,3 +99,9 @@ done
echo "collecting dump of oc get pvc all namespaces" | tee -a "${BASE_COLLECTION_PATH}/gather-debug.log"
{ oc get pvc --all-namespaces; } >> "${BASE_COLLECTION_PATH}/namespaces/all/pvc_all_namespaces"
{ oc adm --dest-dir="${BASE_COLLECTION_PATH}/namespaces/all/" inspect pvc --all-namespaces --"${SINCE_TIME}"; } >> "${BASE_COLLECTION_PATH}/gather-debug.log" 2>&1

# For snapshot of all namespaces
echo "collecting dump of snapshot information for all namespaces" | tee -a "${BASE_COLLECTION_PATH}/gather-debug.log"
{ oc get volumesnapshot --all-namespaces; } >> "${BASE_COLLECTION_PATH}/namespaces/all/get_volumesnapshot_all_namespaces"
{ oc describe volumesnapshot --all-namespaces; } >> "${BASE_COLLECTION_PATH}/namespaces/all/desc_volumesnapshot_all_namespaces"
{ oc adm --dest-dir="${BASE_COLLECTION_PATH}/namespaces/all/" inspect volumesnapshot --all-namespaces --"${SINCE_TIME}"; } >> "${BASE_COLLECTION_PATH}/gather-debug.log" 2>&1

0 comments on commit ae79034

Please sign in to comment.