Skip to content

fix(image): guard against downgrade suggestions on fly image show/update#4853

Merged
Lucais11 merged 2 commits intomasterfrom
fix/image-show-downgrade-guard
Apr 23, 2026
Merged

fix(image): guard against downgrade suggestions on fly image show/update#4853
Lucais11 merged 2 commits intomasterfrom
fix/image-show-downgrade-guard

Conversation

@Lucais11
Copy link
Copy Markdown
Contributor

@Lucais11 Lucais11 commented Apr 22, 2026

Fixes #4812

The backend latestImageDetails resolver can return an image with a lower fly.version than the machine's current one (e.g. for flyio/postgres-flex:16 on v0.2.0 it returns the stale pinned tag 16.6 at v0.1.0). The previous digest-only update check treated any digest mismatch as an update, so users were prompted to downgrade.

Add an IsUpdateCandidate helper that only reports an update when the returned fly.version parses as strictly newer than the machine's current fly.version, falling back to digest inequality when either version is missing or unparseable (preserving prior behavior for custom images).

Wire it into the three call sites that previously compared digests directly: fly image show, fly image update's resolveImage, and fly status.

Lucais11 and others added 2 commits April 22, 2026 14:50
The backend `latestImageDetails` resolver can return an image with a
lower fly.version than the machine's current one (e.g. for
flyio/postgres-flex:16 on v0.2.0 it returns the stale pinned tag
16.6 at v0.1.0). The previous digest-only update check treated any
digest mismatch as an update, so users were prompted to downgrade.

Add an `IsUpdateCandidate` helper that only reports an update when
the returned fly.version parses as strictly newer than the machine's
current fly.version, falling back to digest inequality when either
version is missing or unparseable (preserving prior behavior for
custom images).

Wire it into the three call sites that previously compared digests
directly: `fly image show`, `fly image update`'s resolveImage, and
`fly status`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
golangci-lint's nlreturn flagged the terminal return at the bottom
of the function. Add the required blank line before it.
@Lucais11 Lucais11 merged commit 3003fb6 into master Apr 23, 2026
36 of 37 checks passed
@Lucais11 Lucais11 deleted the fix/image-show-downgrade-guard branch April 23, 2026 03:11
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.

is flyctl image new version resolving logic working as expected?

2 participants