Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --all-platforms flag to LoadImageArchive so that images are not filtered out by ctr #2957

Merged

Conversation

curtbushko
Copy link
Contributor

As discussed in the slack thread, this PR adds the --all-platforms flag to ctr. This makes it easier for folks to load images using local architectures that are different than the kind host architecture (ie, on M1 laptops)

To reproduce:

  1. Pull a image that is not host native (amd64 in this case as I am on arm64):
$ docker pull docker.io/bitnami/kubeapps-apis:2.4.6-debian-11-r18
2.4.6-debian-11-r18: Pulling from bitnami/kubeapps-apis
Digest: sha256:39ac7fbe10718857ce8d15a75760eb1fb081d04521308e1f7520aed19220ae74
Status: Image is up to date for bitnami/kubeapps-apis:2.4.6-debian-11-r18
docker.io/bitnami/kubeapps-apis:2.4.6-debian-11-r18

$ docker inspect docker.io/bitnami/kubeapps-apis:2.4.6-debian-11-r18 |grep 'Architecture'
      "Architecture": "amd64",
  1. Before change (image cannot be loaded):
$ kind load docker-image docker.io/bitnami/kubeapps-apis:2.4.6-debian-11-r18
Image: "" with ID "sha256:df590f58636e2ff336d3ac4b10be40e7b9c1dcdf85a1c253ffc17aaaca4ebda9" not yet present on node "kind-control-plane", loading...
ERROR: failed to load image: command "docker exec --privileged -i kind-control-plane ctr --namespace=k8s.io images import --digests --snapshotter=overlayfs -" failed with error: exit status 1
Command Output: ctr: image might be filtered out
  1. After change (image is copied over):
$ kind load docker-image docker.io/bitnami/kubeapps-apis:2.4.6-debian-11-r18
Image: "" with ID "sha256:df590f58636e2ff336d3ac4b10be40e7b9c1dcdf85a1c253ffc17aaaca4ebda9" not yet present on node "kind-control-plane", loading..

$ docker exec kind-control-plane ctr --namespace=k8s.io images ls |grep 'kubeapps'
docker.io/bitnami/kubeapps-apis:2.4.6-debian-11-r18                                       application/vnd.docker.distribution.manifest.v2+json      sha256:bbf6a77ef73ab2e98496fc1dc93722c3d9c4655ef60511d956d5963fda8f0ef5 344.2 MiB linux/amd64                                                                  io.cri-containerd.image=managed

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 7, 2022
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 7, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @curtbushko. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 7, 2022
@BenTheElder
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 7, 2022
@aojea
Copy link
Contributor

aojea commented Oct 7, 2022

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, curtbushko

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 7, 2022
@k8s-ci-robot k8s-ci-robot merged commit d532257 into kubernetes-sigs:main Oct 7, 2022
@curtbushko curtbushko deleted the all-platforms-image-archive branch October 7, 2022 13:48
aidy added a commit to aidy/ko that referenced this pull request Apr 26, 2023
aidy added a commit to aidy/ko that referenced this pull request Apr 26, 2023
imjasonh pushed a commit to ko-build/ko that referenced this pull request May 23, 2023
aidy added a commit to aidy/ko that referenced this pull request May 26, 2023
imjasonh pushed a commit to ko-build/ko that referenced this pull request Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants