mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Support image status by ID.
This commit is contained in:
parent
b7fa33ec15
commit
e27b263f37
@ -65,12 +65,18 @@ func (ds *dockerService) ImageStatus(_ context.Context, r *runtimeapi.ImageStatu
|
|||||||
image := r.GetImage()
|
image := r.GetImage()
|
||||||
|
|
||||||
imageInspect, err := ds.client.InspectImageByRef(image.Image)
|
imageInspect, err := ds.client.InspectImageByRef(image.Image)
|
||||||
|
if err != nil {
|
||||||
|
if !libdocker.IsImageNotFoundError(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
imageInspect, err = ds.client.InspectImageByID(image.Image)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if libdocker.IsImageNotFoundError(err) {
|
if libdocker.IsImageNotFoundError(err) {
|
||||||
return &runtimeapi.ImageStatusResponse{}, nil
|
return &runtimeapi.ImageStatusResponse{}, nil
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
imageStatus, err := imageInspectToRuntimeAPIImage(imageInspect)
|
imageStatus, err := imageInspectToRuntimeAPIImage(imageInspect)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user