Support image status by ID.

This commit is contained in:
Lantao Liu 2019-06-04 11:34:38 -07:00
parent b7fa33ec15
commit e27b263f37

View File

@ -66,10 +66,16 @@ func (ds *dockerService) ImageStatus(_ context.Context, r *runtimeapi.ImageStatu
imageInspect, err := ds.client.InspectImageByRef(image.Image)
if err != nil {
if libdocker.IsImageNotFoundError(err) {
return &runtimeapi.ImageStatusResponse{}, nil
if !libdocker.IsImageNotFoundError(err) {
return nil, err
}
imageInspect, err = ds.client.InspectImageByID(image.Image)
if err != nil {
if libdocker.IsImageNotFoundError(err) {
return &runtimeapi.ImageStatusResponse{}, nil
}
return nil, err
}
return nil, err
}
imageStatus, err := imageInspectToRuntimeAPIImage(imageInspect)