From 4493297ac81053918d9583da55561a98b2b7c5f6 Mon Sep 17 00:00:00 2001 From: yati1998 Date: Fri, 1 Mar 2024 11:35:37 +0530 Subject: [PATCH] collect resources for openshift-storage-extended ns This commit collects crds and few resources for openshift-storage-extended namespace Signed-off-by: yati1998 --- collection-scripts/gather_ceph_resources | 2 ++ collection-scripts/gather_namespaced_resources | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/collection-scripts/gather_ceph_resources b/collection-scripts/gather_ceph_resources index e89fabb..d3bd3fd 100755 --- a/collection-scripts/gather_ceph_resources +++ b/collection-scripts/gather_ceph_resources @@ -88,8 +88,10 @@ for resource in "${ceph_resources[@]}"; do done namespaces=$(oc get deploy --all-namespaces -o go-template --template='{{range .items}}{{if .metadata.labels}}{{printf "%s %v" .metadata.namespace (index .metadata.labels "olm.owner")}} {{printf "\n"}}{{end}}{{end}}' | grep ocs-operator | awk '{print $1}' | uniq) +namespaces="openshift-storage-extended" # Inspecting the namespace where ocs-cluster is installed for ns in $namespaces; do + dblog "collecting details of ns ${ns}" ceph_collection() { COMMAND_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/must_gather_commands COMMAND_JSON_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/must_gather_commands_json_output diff --git a/collection-scripts/gather_namespaced_resources b/collection-scripts/gather_namespaced_resources index 9ea0052..6c2b5fb 100755 --- a/collection-scripts/gather_namespaced_resources +++ b/collection-scripts/gather_namespaced_resources @@ -54,6 +54,7 @@ commands_desc+=("pods") commands_desc+=("hpa") commands_desc+=("subscription") commands_desc+=("storagecluster") +commands_desc+=("storagesystem") commands_desc+=("storageconsumer") commands_desc+=("storageprofiles") commands_desc+=("storageclassrequest") @@ -100,13 +101,12 @@ for INSTALL_NAMESPACE in $PRODUCT_NAMESPACE $INSTALL_NAMESPACES $MANAGED_FUSION_ # shellcheck disable=SC2086 { oc describe ${command_desc} -n ${INSTALL_NAMESPACE}; } >>"${COMMAND_OUTPUT_FILE}" done + # NOTE: This is a temporary fix for collecting the storagecluster as we are not able to collect the storagecluster using the inspect command + { oc get storageclusters -n "${INSTALL_NAMESPACE}" -o yaml; } >"${BASE_COLLECTION_PATH}/namespaces/${INSTALL_NAMESPACE}/oc_output/storagecluster.yaml" 2>&1 + { oc get storagesystem -n "${INSTALL_NAMESPACE}" -o yaml; } >"${BASE_COLLECTION_PATH}/namespaces/${INSTALL_NAMESPACE}/oc_output/storagesystem.yaml" 2>&1 + { oc get storageconsumer -n "${INSTALL_NAMESPACE}" -o yaml; } >"${BASE_COLLECTION_PATH}/namespaces/${INSTALL_NAMESPACE}/oc_output/storageconsumer.yaml" 2>&1 done -# NOTE: This is a temporary fix for collecting the storagecluster as we are not able to collect the storagecluster using the inspect command -{ oc get storageclusters -n "${INSTALL_NAMESPACE}" -o yaml; } >"${BASE_COLLECTION_PATH}/namespaces/${INSTALL_NAMESPACE}/oc_output/storagecluster.yaml" 2>&1 -{ oc get storagesystem -n "${INSTALL_NAMESPACE}" -o yaml; } >"${BASE_COLLECTION_PATH}/namespaces/${INSTALL_NAMESPACE}/oc_output/storagesystem.yaml" 2>&1 -{ oc get storageconsumer -n "${INSTALL_NAMESPACE}" -o yaml; } >"${BASE_COLLECTION_PATH}/namespaces/${INSTALL_NAMESPACE}/oc_output/storageconsumer.yaml" 2>&1 - # Collect oc get events with sorted timestamp dbglog "collecting output of oc get events with sorted timestamp" { oc get event -o custom-columns="LAST SEEN:{lastTimestamp},FIRST SEEN:{firstTimestamp},COUNT:{count},NAME:{metadata.name},KIND:{involvedObject.kind},SUBOBJECT:{involvedObject.fieldPath},TYPE:{type},REASON:{reason},SOURCE:{source.component},MESSAGE:{message}" --sort-by=lastTimestamp -n openshift-storage; } >"${BASE_COLLECTION_PATH}/namespaces/${INSTALL_NAMESPACE}/oc_output/events_get" 2>&1