Show events when install failed (#15753)

Signed-off-by: Jenny Li <jing.li@zilliz.com>
pull/15614/merge
Jenny Li 2022-02-25 18:01:53 +08:00 committed by GitHub
parent d67c801511
commit 51cac044aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,14 @@ do
echo "${restart_pod} restarts ${restart_count}, last terminateed reason is ${reason}"
done
# Show related events when helm install failed
if [[ ${exitcode} -ne 0 ]];then
failed_pods=$(kubectl get pods --field-selector status.phase!=Running,status.phase!=Completed -n ${MILVUS_HELM_NAMESPACE} | grep "${MILVUS_HELM_RELEASE_NAME}-" | awk '{print $1}' )
for failed_pod in ${failed_pods}
do
kubectl get events -n ${MILVUS_HELM_NAMESPACE} --field-selector involvedObject.name="${failed_pod}"
done
fi
kubectl get pvc -n ${MILVUS_HELM_NAMESPACE} | grep "${MILVUS_HELM_RELEASE_NAME}-" | awk '{$3=null;print $0}'
exit ${exitcode}