-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use local image if input image is a manifest list #7798
Use local image if input image is a manifest list #7798
Conversation
@containers/podman-maintainers PTAL |
@nalind PTAL |
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will match any local image which is also in the list, so it solves the problem when only one of them is present. If I've pulled more than one using the repository name and their respective digests, this will choose the first one in the list, when the one for the current architecture (if one is present) could be listed later in images
. Instead of checking for any of the values returned by list.Instances()
, can we use list.ChooseInstance()
to select the one that would be correct for the current architecture, and only accept an image that matches the digest it returns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
34fd91a
to
29c5903
Compare
@nalind @containers/podman-maintainers PTAL |
LGTM |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: QiWang19, rhatdan 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 |
@@ -33,7 +34,42 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat | |||
|
|||
_, mediaType, err := newImage.Manifest(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have to set this mediaType somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mediaType will be used to check if its a manifest.DockerV2Schema2MediaType
https://github.com/containers/podman/pull/7798/files#diff-5a91791543058d94a51dab8d8294ca7cR75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if the newImage.Manifest(ctx) check fails, the nediaType is never set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. If we do find a suitable image and update newImage
to point to it, we need to make sure that mediaType
is updated to the value that correctly describes its manifest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If newImage.Manifest(ctx) fails, use the mediaType of the local image.
If run&create image returns error: image contains manifest list, not a runnable image, find the local image that has digest matching the digest from the list and use the image from local storage for the command. Signed-off-by: Qi Wang <[email protected]>
29c5903
to
d24ec64
Compare
/lgtm |
/hold cancel |
If run&create image returns error: image contains manifest list, not a runnable image, find the local image that has digest matching the digest from the list and use the image from local storage for the command.
close #7233
Signed-off-by: Qi Wang [email protected]