close
Skip to content

improve error message when image save platform is not available#1418

Merged
jglogan merged 2 commits intoapple:mainfrom
knQzx:improve-image-save-platform-error
Apr 20, 2026
Merged

improve error message when image save platform is not available#1418
jglogan merged 2 commits intoapple:mainfrom
knQzx:improve-image-save-platform-error

Conversation

@knQzx
Copy link
Copy Markdown
Contributor

@knQzx knQzx commented Apr 14, 2026

summary

  • image save now fails fast with a clear error when the requested platform is not available locally
  • the message lists the platforms that ARE available so the user knows what they can save

before:
Error: notFound: "Content with digest sha256:..."

after:
Error: image alpine:latest has no content for platform linux/amd64; available platforms: linux/arm64

test plan

  • verified locally against a multi-arch image with platforms amd64/arm64/ppc64le/s390x/386/arm-v6/arm-v7:
    • save --platform linux/arm/v5 (not in image) fails with the new error listing all real platforms (attestation unknown/unknown entries are filtered out)
    • save --platform linux/arm64 (in image) succeeds as before
    • save without --platform still saves the full multi-arch archive (pre-check is skipped)

fixes #874

@knQzx knQzx force-pushed the improve-image-save-platform-error branch from da90dc1 to 886ee7d Compare April 14, 2026 22:55
Comment thread Sources/ContainerCommands/Image/ImageSave.swift
@knQzx
Copy link
Copy Markdown
Contributor Author

knQzx commented Apr 19, 2026

@jglogan added test

@JaewonHur JaewonHur requested a review from jglogan April 20, 2026 16:54
@jglogan jglogan merged commit 49079da into apple:main Apr 20, 2026
3 checks passed
@jglogan
Copy link
Copy Markdown
Contributor

jglogan commented Apr 20, 2026

@knQzx Thank you!

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.

[Bug]: Image save error output is too low-level.

3 participants