fix(image): guard against downgrade suggestions on fly image show/update#4853
Merged
fix(image): guard against downgrade suggestions on fly image show/update#4853
Conversation
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.
dangra
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4812
The backend
latestImageDetailsresolver 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
IsUpdateCandidatehelper 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, andfly status.