Skip to content

fix(updater): keep a container when the post-pull comparison fails - #33

Merged
kmendell merged 1 commit into
getarcaneapp:mainfrom
neurekadev:fix/32-failed-digest-comparison
Nov 26, 2026
Merged

kmendell merged 1 commit into
getarcaneapp:mainfrom
neurekadev:fix/32-failed-digest-comparison

Conversation

@neurekadev

@neurekadev neurekadev commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

UpdateContainer recreated a container when it could not tell whether the pulled image differs from the one the container runs. After the pull, a failed comparison (for example a failed ImageInspect of the pulled reference) only stopped the update for tag changes. For a digest update it fell through to the recreate, so a transient inspect failure restarted a container that may already run the current image, and reported it as updated.

Arcane reaches this from its single-container update, which the UI's container update and the container update webhook use. A webhook that fires after every CI run could therefore restart a container whose image did not change.

Changes

  • updater/container.go: a failed post-pull comparison now reports the container as failed with the comparison error and leaves it running, the same way a failed pull does. A forced digest update (Options.Force) still recreates without a comparison, since it does so even when the digest is unchanged. Tag changes keep failing on a comparison error, as before.
  • Not changed: the post-pull decision also exists in pullTargetPlans (updater/targeted.go, which fails on an inspect error even when forced) and in applyUpdatePlan with RestartContainersUsingOldImages (updater/apply.go, updater/restart.go, which restart image-wide pending records when the image-ID lookup fails). Both differences predate this PR and only show when an inspect fails right after a successful pull; the code doesn't show which behavior is right, so unifying them needs that decision first. The review comment below lists both.

Checks

Run in golang:1.27.4 and golangci/golangci-lint:v2.15.0 containers, for the updater module:

  • go vet ./... and go test -race ./... pass.
  • golangci-lint fmt --diff (no diff) and golangci-lint run (0 issues).
  • New row in the existing TestUpdateContainerTagSelection table, failed digest comparison leaves container running: every image inspect fails, and the case expects one failed result, one pull, and no Docker mutations. On main it fails because the container is recreated and reported as updated. With this change it passes.

Arcane picks this up at its next kit.getarcane.app/updater bump.

Closes #32

🤖 Generated with Claude Code

UpdateContainer recreated the container when it could not compare the
pulled image with the container's image, unless the update changed the
tag. A transient inspect failure therefore restarted a container that may
already run the current image, and reported it as updated. A failed
comparison now fails the container with the comparison error and leaves
it running; only a forced digest update still recreates it.

Fixes getarcaneapp#32

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@neurekadev

Copy link
Copy Markdown
Contributor Author

🔍 Code Review

PR #33 · 50c2a32..f3a2abf · 2 files · ✅ No blocking issues remain

Critical: 0 High: 0 Medium: 0 Low: 2 Informational: 0

# Severity Finding Status
1 Low Forced post-pull check differs from targeted records (pre-existing)
updater/targeted.go:327 · duplication
📝 Reported
2 Low Image-wide pending records restart on a failed lookup (pre-existing)
updater/apply.go:157 · duplication
📝 Reported
Low and informational (2)
  • 1 · Forced post-pull check differs from targeted records (updater/targeted.go:327)
    • Scenario: A forced run where the pull succeeds but inspecting the pulled image fails: UpdateContainer (container.go:122-126, via CompareWithPulled) recreates the container, while pullTargetPlans (targeted.go:327-336, an inline inspect and ID compare) fails it.
    • Evidence: Both decide fail, up to date, or recreate for one container after a pull. This PR narrowed the difference to forced runs; the code does not show which forced behavior is right.
    • 📝 Reported: Pre-existing and Low: needs Force plus a failed inspect right after a successful pull. A shared post-pull decision (pullTargetPlans calling CompareWithPulled) needs that decision first.
  • 2 · Image-wide pending records restart on a failed lookup (updater/apply.go:157)
    • Scenario: An image-wide digest record is the only kind of pending record and the post-pull image-ID lookup fails: applyUpdatePlan returns updated and RestartContainersUsingOldImages restarts its containers (restart.go:84 drops the lookup error). With any container-scoped or tag record also pending, the same record goes through targeted.go and fails instead.
    • Evidence: apply.go:28-29 routes all records to applyTargetedRecords when any is a tag or container-scoped record; apply.go:157-163 skips the comparison on a lookup error; digestcheck.go:224 drops it. The PR text's reason for leaving apply.go alone also describes targeted records, so it does not separate the two paths.
    • 📝 Reported: Pre-existing and Low: needs the inspect and the image list to fail after a successful pull, and the record already shows a newer digest. The PR description is corrected to say so.

🤖 Claude Opus 5.5 (High) · T3 Code (Claude Code) · Round 1 of 3

@neurekadev
neurekadev marked this pull request as ready for review November 23, 2026 07:48
@neurekadev
neurekadev requested a review from a team as a code owner November 23, 2026 07:48
@kmendell
kmendell merged commit 8acb542 into getarcaneapp:main Nov 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

updater: UpdateContainer recreates the container when the post-pull digest comparison fails

2 participants