Skip to content

Commit

Permalink
add warning events to deployment/pod error debug
Browse files Browse the repository at this point in the history
  • Loading branch information
gabemontero committed Jan 19, 2023
1 parent 14ce609 commit ea760cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions operator/images/cluster-setup/content/bin/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ check_deployments() {
if ! timeout 300s bash -c "while ! kubectl get deployment/$deploy -n $ns >/dev/null 2>/dev/null; do printf '.'; sleep 10; done"; then
printf "%s not found (timeout)\n" "$deploy"
kubectl get deployment/"$deploy" -n "$ns"
kubectl -n "$ns" get events | grep Warning
exit 1
else
printf "Exists"
Expand All @@ -43,6 +44,7 @@ check_deployments() {
else
kubectl -n "$ns" describe "deployment/$deploy"
kubectl -n "$ns" logs "deployment/$deploy"
kubectl -n "$ns" get events | grep Warning
exit 1
fi
done
Expand All @@ -62,6 +64,7 @@ check_pod_by_label() {
i=$((i+1))
if [[ $i -eq "${numOfAttempts}" ]]; then
printf "\n[ERROR] Pod %s not found by timeout \n" "$label" >&2
kubectl -n "$ns" get events | grep Warning
exit 1
fi
done
Expand All @@ -75,6 +78,7 @@ check_pod_by_label() {
printf "\n[ERROR] Pod %s failed to start\n" "$label" >&2
kubectl -n "$ns" describe pod -l "$label"
kubectl -n "$ns" logs -l "$label"
kubectl -n "$ns" get events | grep Warning
exit 1
fi
}
Expand Down

0 comments on commit ea760cf

Please sign in to comment.