-
Notifications
You must be signed in to change notification settings - Fork 0
GetImage to return image tags with details #55
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,10 +173,14 @@ func (i *ImageService) GetImage(ctx context.Context, refOrID string, options ima | |
| } | ||
|
|
||
| lastUpdated, err := i.imageStore.GetLastUpdated(img.ID()) | ||
|
|
||
| references := i.referenceStore.References(img.ID().Digest()) | ||
|
|
||
|
Comment on lines
+176
to
+178
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
references := i.referenceStore.References(img.ID().Digest())
if options.Details {
// get size etc
img.Details = &image.Details{
References: references,
Size: size,
Metadata: layerMetadata,
Driver: i.layerStore.DriverName(),
LastUpdated: lastUpdated,
}
} else {
img.Details = &image.Details{
References: references,
}
}
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^^ discussed this with @ndeloof, and for this use-case (docker image inspect) we already have |
||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| img.Details = &image.Details{ | ||
| References: references, | ||
| Size: size, | ||
| Metadata: layerMetadata, | ||
| Driver: i.layerStore.DriverName(), | ||
|
|
||
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.
Would it also work if we'd check if
s.referenceBackendis empty, and if so, fill it withimg.Name()(or whatever is needed)? Something like;Or would we need the image name passed for that?
(Mostly seeing if we can keep the change to where it's a problem, and to have a clear TODO that needs fixing)
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.
Sure we could just drop this line, but my goal here is to prepare the required refactoring so we get the codebase ready while I investigate how to retrieve all tags from containerd snaphsotter