From fbf9932d5a580a0e771bfedc3a9eddcbcefec2aa Mon Sep 17 00:00:00 2001 From: cadenmarchese Date: Mon, 30 Oct 2023 15:48:19 -0400 Subject: [PATCH] add aro support to must-gather --- collection-scripts/gather | 3 +++ collection-scripts/gather_aro | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 collection-scripts/gather_aro diff --git a/collection-scripts/gather b/collection-scripts/gather index 4e012d1d..44a8db0a 100755 --- a/collection-scripts/gather +++ b/collection-scripts/gather @@ -114,5 +114,8 @@ oc adm inspect --dest-dir must-gather --rotated-pod-logs "${all_ns_resources[@]} # Gather Performance profile information /usr/bin/gather_ppc +# Gather ARO information +/usr/bin/gather_aro + # force disk flush to ensure that all data gathered is accessible in the copy container sync diff --git a/collection-scripts/gather_aro b/collection-scripts/gather_aro new file mode 100755 index 00000000..1d2f0700 --- /dev/null +++ b/collection-scripts/gather_aro @@ -0,0 +1,22 @@ +#!/bin/bash +BASE_COLLECTION_PATH="must-gather" +ARO_CR_NAME="clusters.aro.openshift.io" + +IS_ARO=$(oc get ${ARO_CR_NAME} --ignore-not-found=true ) +if [ -z "$IS_ARO" ]; then + exit 0 +fi + +function gather_aro() { + echo "INFO: Collecting ARO Cluster Data" + declare -a INSPECT_TARGETS=(${ARO_CR_NAME} "ns/openshift-azure-operator" "ns/openshift-azure-logging") + + for TARGET in "${INSPECT_TARGETS[@]}"; do + oc adm inspect --dest-dir "${BASE_COLLECTION_PATH}" "${TARGET}" + done +} + +gather_aro + +# force disk flush to ensure that all data gathered are written +sync \ No newline at end of file