Report container build failures to API before cleanup
Adds calls to post_update_to_api to notify the API of container build failures before prompting for container cleanup in both build and error handler scripts.
This commit is contained in:
parent
50c1b8f492
commit
9e4d367415
@ -3262,6 +3262,9 @@ EOF'
|
||||
exit $install_exit_code
|
||||
fi
|
||||
|
||||
# Report failure to API before container cleanup
|
||||
post_update_to_api "failed" "$install_exit_code"
|
||||
|
||||
# Prompt user for cleanup with 60s timeout (plain echo - no msg_info to avoid spinner)
|
||||
echo ""
|
||||
echo -en "${YW}Remove broken container ${CTID}? (Y/n) [auto-remove in 60s]: ${CL}"
|
||||
|
||||
@ -213,6 +213,11 @@ error_handler() {
|
||||
|
||||
# Offer to remove container if it exists (build errors after container creation)
|
||||
if [[ -n "${CTID:-}" ]] && command -v pct &>/dev/null && pct status "$CTID" &>/dev/null; then
|
||||
# Report failure to API before container cleanup
|
||||
if declare -f post_update_to_api &>/dev/null; then
|
||||
post_update_to_api "failed" "$exit_code"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -en "${YW}Remove broken container ${CTID}? (Y/n) [auto-remove in 60s]: ${CL}"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user