fix: correctly propagate remote command exit status
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 10m7s

This commit is contained in:
2026-03-02 00:52:24 +00:00
parent c794e07ab2
commit 9b03cec23e

View File

@@ -97,12 +97,14 @@ remote() {
quoted_cmd="$(printf '%q' "$cmd")" quoted_cmd="$(printf '%q' "$cmd")"
for candidate in "${candidates[@]}"; do for candidate in "${candidates[@]}"; do
if ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd"; then ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd"
rc=$?
if [ "$rc" -eq 0 ]; then
ACTIVE_SSH_USER="$candidate" ACTIVE_SSH_USER="$candidate"
return 0 return 0
fi fi
rc=$?
if [ "$rc" -ne 255 ]; then if [ "$rc" -ne 255 ]; then
return "$rc" return "$rc"
fi fi