core: add progress; fix exit status

Introduce post_progress_to_api() in alpine-install.func and install.func to send a lightweight, fire-and-forget telemetry ping (HTTP POST) that updates an existing telemetry record to "configuring" when DIAGNOSTICS=yes and RANDOM_UUID is set. The function is non-blocking (curl -m 5, errors ignored) and is invoked during container setup and after OS updates to signal active progress. Also adjust api_exit_script() in build.func to report success (post_update_to_api "done" "0") for cases where the script exited normally but a completion status wasn't posted, instead of reporting failure.
This commit is contained in:
CanbiZ (MickLesk)
2026-02-17 09:02:05 +01:00
parent 52a9e23401
commit 50effb6d86
3 changed files with 44 additions and 2 deletions
+2 -2
View File
@@ -5265,8 +5265,8 @@ api_exit_script() {
post_update_to_api "failed" "$exit_code"
elif [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
# Script exited with 0 but never sent a completion status
# This catches edge cases like early returns after post_to_api()
post_update_to_api "failed" "1"
# exit_code=0 is never an error — report as success
post_update_to_api "done" "0"
fi
}