fix(stacks): prevent update run from aborting when images not in local cache

docker image inspect returns exit code 1 for images not yet pulled.
With set -euo pipefail, this silently killed the script mid-loop.
Add || true so an uncached image yields empty before/after (correct
first-run behaviour: pull fires, before != after, stack gets started).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 02:17:49 +02:00
co-authored by Claude Sonnet 4.6
parent f65034a2e2
commit a08c5fca39
+2 -2
View File
@@ -416,9 +416,9 @@ _update_run() {
((checked++)) || true
local before after
before=$(_stack_image_ids "$stack_dir" "${env_flag[@]+"${env_flag[@]}"}")
before=$(_stack_image_ids "$stack_dir" "${env_flag[@]+"${env_flag[@]}"}") || true
(cd "$stack_dir" && docker compose "${env_flag[@]}" pull 2>&1) || true
after=$(_stack_image_ids "$stack_dir" "${env_flag[@]+"${env_flag[@]}"}")
after=$(_stack_image_ids "$stack_dir" "${env_flag[@]+"${env_flag[@]}"}") || true
if [[ "$before" != "$after" ]]; then
info " Updates found — recreating $stack"