feat: Adding platform flag to image download - #10853
geoffo-dev wants to merge 3 commits into
Conversation
The download images command pulls images with the host's default platform, so running it on an arm64 machine (e.g. Apple Silicon Mac) produces an air-gapped tarball of arm64 images even when the target cluster is amd64. Add a --platform flag (e.g. linux/amd64) that is passed through to docker pull so users can choose the architecture of the downloaded images. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019dfddgR1ZFJyiWsQpchA1U
The --platform flag only reached `docker pull`; the tarball is written by `docker save`, which kept exporting the host platform. With the containerd image store, `docker pull --platform` fetches only the requested arch's blobs, so a plain `docker save` exports a multi-arch index it can't resolve and fails (or exports the wrong arch) — the downloaded images were not the requested platform. Thread the platform through ImageDiskDestination -> SaveToFile so `download images --platform linux/amd64` runs `docker save --platform linux/amd64`, mirroring the option pattern already used on the source side. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add --platform flag to download images for cross-arch airgapped bundles - this should allow arm machines to pull amd images for upload to a remote server.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @geoffo-dev. Thanks for your PR. I'm waiting for a aws member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Issue #, if available:
Description of changes:
This will allow machines such as macs to download images in a different architecture for airgapped environments.
Testing (if applicable):
Have built the cli tool and have run the download option with the platform flag. This has produced an images.tar file which contains amd images on an arm machine.
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.