Report each teardown and setup step from what it did, not from whether it was attempted

This commit is contained in:
Gmer4Lfe
2026-08-16 21:46:26 -04:00
parent 65516ea3ac
commit 5bdf3bff60
5 changed files with 109 additions and 33 deletions
+11 -3
View File
@@ -507,6 +507,7 @@ ensure_stack_networks_on_remote() {
# ==============================================================================================
cleanup_deployed_stack_on_remote() {
local remote_ip="$1" ssh_key="$2"
local _rc=0
local -a xml_names=()
[[ ${#PARTNERSHIP_AUTH_STACK[@]} -gt 0 ]] && xml_names+=("${PARTNERSHIP_AUTH_STACK[@]}")
[[ ${#PARTNERSHIP_ARR_STACK[@]} -gt 0 ]] && xml_names+=("${PARTNERSHIP_ARR_STACK[@]}")
@@ -552,13 +553,20 @@ cleanup_deployed_stack_on_remote() {
while IFS= read -r path; do
[[ -z "$path" ]] && continue
timeout "$SSH_TIMEOUT" ssh -i "$ssh_key" \
if timeout "$SSH_TIMEOUT" ssh -i "$ssh_key" \
-o ConnectTimeout="$SSH_TIMEOUT" -o BatchMode=yes root@"$remote_ip" \
"rm -rf '$path' && echo removed" 2>/dev/null | grep -q removed && \
echo " Appdata removed on $MIRROR: $path" || \
"rm -rf '$path' && echo removed" 2>/dev/null | grep -q removed; then
echo " Appdata removed on $MIRROR: $path"
else
warn " Failed to remove appdata on $MIRROR: $path"
_rc=1
fi
done <<< "$appdata_paths"
done
# Only appdata failures are counted. The container branch above cannot tell "removal failed"
# from "already gone" — both produce no `removed` echo — and an offboard re-run on a
# half-finished teardown is a normal case, so treating that as failure would cry wolf.
return "$_rc"
}
# ==============================================================================================