Skip to content

Commit

Permalink
Fix collect crunchy data when using --diagnostic-all (#129)
Browse files Browse the repository at this point in the history
* Fix collect crunchy data when using --diagnostic-all

Co-authored-by: William McEnery <[email protected]>
  • Loading branch information
WilliamMcEnery and William McEnery authored Feb 26, 2024
1 parent c35b93d commit c99b3be
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions generate_postmortem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,6 @@ for switch in $@; do
;;
*"--diagnostic-manager"*)
DIAG_MANAGER=1
EDB_CLUSTER_NAME=$($KUBECTL get cluster --all-namespaces -o=jsonpath='{.items[0].metadata.name}' 2>/dev/null)
if [[ -z "$EDB_CLUSTER_NAME" ]]; then
COLLECT_CRUNCHY=1
SCRIPT_LOCATION="`pwd`/crunchy_gather.py"
else
COLLECT_EDB=1
is_kubectl_cnp_plugin
SCRIPT_LOCATION="`pwd`/edb_mustgather.sh"
fi
if [[ ! -f $SCRIPT_LOCATION ]]; then
echo -e "Unable to locate script ${SCRIPT_LOCATION} in current directory. Download from GitHub repository. Exiting..."
exit 1
fi
;;
*"--diagnostic-gateway"*)
DIAG_GATEWAY=1
Expand Down Expand Up @@ -268,6 +255,22 @@ if [[ $? -ne 0 ]]; then
exit 1
fi
fi

if [[ $DIAG_MANAGER -eq 1 ]]; then
EDB_CLUSTER_NAME=$($KUBECTL get cluster --all-namespaces -o=jsonpath='{.items[0].metadata.name}' 2>/dev/null)
if [[ -z "$EDB_CLUSTER_NAME" ]]; then
COLLECT_CRUNCHY=1
SCRIPT_LOCATION="`pwd`/crunchy_gather.py"
else
COLLECT_EDB=1
is_kubectl_cnp_plugin
SCRIPT_LOCATION="`pwd`/edb_mustgather.sh"
fi
if [[ ! -f $SCRIPT_LOCATION ]]; then
echo -e "Unable to locate script ${SCRIPT_LOCATION} in current directory. Download from GitHub repository. Exiting..."
exit 1
fi
fi
#------------------------------------------------------------------------------------------------------

#------------------------------------------ custom functions ------------------------------------------
Expand Down

0 comments on commit c99b3be

Please sign in to comment.