Skip to content

Commit

Permalink
[minor] Mustgather update to collect additional dependencies and reso…
Browse files Browse the repository at this point in the history
…urces (#1268)
  • Loading branch information
mattlrx authored Sep 30, 2024
1 parent 239b6b8 commit 002e881
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
38 changes: 26 additions & 12 deletions image/cli/mascli/functions/must_gather
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function mustgather() {
echo_h3 "Cluster Resources"
startTimer

for RESOURCE in nodes storageclasses clusterversions
for RESOURCE in nodes storageclasses clusterversions imagecontentsourcepolicy
do
$MG_SCRIPT_DIR/mg-collect-resources -r $RESOURCE -d $OUTPUT_DIR/resources
done
Expand Down Expand Up @@ -245,22 +245,21 @@ function mustgather() {
fi

echo_h3 "IBM Db2 Universal Operator"
NAMESPACE_LOOKUP=$(oc get namespace db2u --ignore-not-found)
if [[ "$NAMESPACE_LOOKUP" != "" ]]; then
DB2U_NAMESPACES=$(oc get db2ucluster -A --ignore-not-found -o jsonpath='{.items[*].metadata.namespace}' | tr " " "\n" |sort | uniq)
for DB2U_NAMESPACE in $DB2U_NAMESPACES
do
$MG_SCRIPT_DIR/mg-summary-db2u &> ${OUTPUT_DIR}/db2u.txt
genericMustGather db2u
else
echo_highlight "Unable to find db2u namespace"
fi
genericMustGather $DB2U_NAMESPACE
done

echo_h3 "IBM Data Reporter Operator"
NAMESPACE_LOOKUP=$(oc get namespace redhat-marketplace --ignore-not-found)
if [[ "$NAMESPACE_LOOKUP" != "" ]]; then
DRO_NAMESPACE_LOOKUP=$(oc get DataReporterConfig -A --ignore-not-found -o jsonpath='{.items[*].metadata.namespace}')
if [[ "$DRO_NAMESPACE_LOOKUP" != "" ]]; then
$MG_SCRIPT_DIR/mg-summary-dro &> ${OUTPUT_DIR}/dro.txt
genericMustGather redhat-marketplace DataReporterConfig,MarketplaceConfig,MeterReport,MeterBase,RazeeDeployment,MeterDefinition
genericMustGather $DRO_NAMESPACE_LOOKUP DataReporterConfig,MarketplaceConfig,MeterReport,MeterBase,RazeeDeployment,MeterDefinition
else
echo_highlight "Unable to find redhat-marketplace namespace"
fi
echo_highlight "Unable to find namespace for DRO"
fi

echo_h3 "Red Hat Certificate Manager"
NAMESPACE_LOOKUP=$(oc get namespace cert-manager-operator --ignore-not-found)
Expand All @@ -278,6 +277,21 @@ function mustgather() {
echo_highlight "Unable to find cert-manager namespace"
fi

echo_h3 "Kafka"
KAFKA_NAMESPACES=$(oc get Kafka -A --ignore-not-found -o jsonpath='{.items[*].metadata.namespace}')
for KAFKA_NAMESPACE in $KAFKA_NAMESPACES
do
$MG_SCRIPT_DIR/mg-summary-kafka &> ${OUTPUT_DIR}/kafka.txt
genericMustGather $KAFKA_NAMESPACE Kafka,KafkaUser
done

echo_h3 "Grafana"
GRAFANA_NAMESPACES=$(oc get Grafana -A --ignore-not-found -o jsonpath='{.items[*].metadata.namespace}')
for GRAFANA_NAMESPACE in $GRAFANA_NAMESPACES
do
$MG_SCRIPT_DIR/mg-summary-kafka &> ${OUTPUT_DIR}/kafka.txt
genericMustGather $GRAFANA_NAMESPACE Grafana,GrafanaDatasource
done

MONGOCE_NAMESPACES=$(oc get mongodbcommunity --all-namespaces --ignore-not-found -o jsonpath='{.items[*].metadata.namespace}')
for MONGOCE_NAMESPACE in $MONGOCE_NAMESPACES
Expand Down
8 changes: 8 additions & 0 deletions image/cli/mascli/must-gather/mg-collect-mas-manage
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NAMESPACE=$1
OUTPUT_DIR=$2

# Collect build Resources
# -----------------------------------------------------------------------------
echo_h4 "Collect Build Resources"
for RESOURCE in build buildconfig imagestream imagestreamtag
do
$DIR/mg-collect-resources -n $NAMESPACE -r $RESOURCE -d $OUTPUT_DIR/resources
done

# Collect Manage Logs
# -----------------------------------------------------------------------------
echo_h4 "Collect Manage Files"
Expand Down

0 comments on commit 002e881

Please sign in to comment.