mirror of
https://github.com/containers/podman.git
synced 2025-06-12 02:45:09 +08:00
Fix misc stuff found by jhonce
During the python client implementation, jhonce found some return types that needed correction as well as a panic related to history which is now corrected. Signed-off-by: baude <bbaude@redhat.com> Closes: #704 Approved by: rhatdan
This commit is contained in:
@ -88,11 +88,11 @@ method InspectImage(name: string) -> (image: string)
|
|||||||
method HistoryImage(name: string) -> (history: []ImageHistory)
|
method HistoryImage(name: string) -> (history: []ImageHistory)
|
||||||
method PushImage(name: string, tag: string, tlsverify: bool) -> ()
|
method PushImage(name: string, tag: string, tlsverify: bool) -> ()
|
||||||
method TagImage(name: string, tagged: string) -> ()
|
method TagImage(name: string, tagged: string) -> ()
|
||||||
method RemoveImage(name: string, force: bool) -> ()
|
method RemoveImage(name: string, force: bool) -> (image: string)
|
||||||
method SearchImage(name: string, limit: int) -> (images: []ImageSearch)
|
method SearchImage(name: string, limit: int) -> (images: []ImageSearch)
|
||||||
method DeleteUnusedImages() -> (images: []string)
|
method DeleteUnusedImages() -> (images: []string)
|
||||||
method CreateFromContainer() -> (notimplemented: NotImplemented)
|
method CreateFromContainer() -> (notimplemented: NotImplemented)
|
||||||
method ImportImage(source: string, reference: string, message: string, changes: []string) -> (id: string)
|
method ImportImage(source: string, reference: string, message: string, changes: []string) -> (image: string)
|
||||||
method ExportImage(name: string, destination: string, compress: bool) -> ()
|
method ExportImage(name: string, destination: string, compress: bool) -> ()
|
||||||
method PullImage(name: string) -> (id: string)
|
method PullImage(name: string) -> (id: string)
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -92,15 +92,23 @@ func (i *LibpodAPI) HistoryImage(call ioprojectatomicpodman.VarlinkCall, name st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return call.ReplyErrorOccurred(err.Error())
|
return call.ReplyErrorOccurred(err.Error())
|
||||||
}
|
}
|
||||||
var histories []ioprojectatomicpodman.ImageHistory
|
var (
|
||||||
for i, h := range history {
|
histories []ioprojectatomicpodman.ImageHistory
|
||||||
|
count = 1
|
||||||
|
)
|
||||||
|
for i := len(history) - 1; i >= 0; i-- {
|
||||||
|
var size int64
|
||||||
|
if !history[i].EmptyLayer {
|
||||||
|
size = layerInfos[len(layerInfos)-count].Size
|
||||||
|
count++
|
||||||
|
}
|
||||||
imageHistory := ioprojectatomicpodman.ImageHistory{
|
imageHistory := ioprojectatomicpodman.ImageHistory{
|
||||||
Id: newImage.ID(),
|
Id: newImage.ID(),
|
||||||
Created: h.Created.String(),
|
Created: history[i].Created.String(),
|
||||||
CreatedBy: h.CreatedBy,
|
CreatedBy: history[i].CreatedBy,
|
||||||
Tags: newImage.Names(),
|
Tags: newImage.Names(),
|
||||||
Size: layerInfos[i].Size,
|
Size: size,
|
||||||
Comment: h.Comment,
|
Comment: history[i].Comment,
|
||||||
}
|
}
|
||||||
histories = append(histories, imageHistory)
|
histories = append(histories, imageHistory)
|
||||||
}
|
}
|
||||||
@ -165,7 +173,7 @@ func (i *LibpodAPI) RemoveImage(call ioprojectatomicpodman.VarlinkCall, name str
|
|||||||
if err := newImage.Remove(force); err != nil {
|
if err := newImage.Remove(force); err != nil {
|
||||||
return call.ReplyErrorOccurred(err.Error())
|
return call.ReplyErrorOccurred(err.Error())
|
||||||
}
|
}
|
||||||
return call.ReplyRemoveImage()
|
return call.ReplyRemoveImage(newImage.ID())
|
||||||
}
|
}
|
||||||
|
|
||||||
// SearchImage searches all registries configured in /etc/containers/registries.conf for an image
|
// SearchImage searches all registries configured in /etc/containers/registries.conf for an image
|
||||||
|
Reference in New Issue
Block a user