Commit 5b3a44fd authored by Alok Kumar Singh's avatar Alok Kumar Singh
parent 5c113cf4
......@@ -161,12 +161,3 @@ func matchImageIDOnly(inspected dockertypes.ImageInspect, image string) bool {
klog.V(4).Infof("The reference %s does not directly refer to the given image's ID (%q)", image, inspected.ID)
return false
}
// isImageNotFoundError returns whether the err is caused by image not found in docker
// TODO: Use native error tester once ImageNotFoundError is supported in docker-engine client(eg. ImageRemove())
func isImageNotFoundError(err error) bool {
if err != nil {
return strings.Contains(err.Error(), "No such image:")
}
return false
}
......@@ -399,7 +399,7 @@ func (d *kubeDockerClient) RemoveImage(image string, opts dockertypes.ImageRemov
if ctxErr := contextError(ctx); ctxErr != nil {
return nil, ctxErr
}
if isImageNotFoundError(err) {
if dockerapi.IsErrNotFound(err) {
return nil, ImageNotFoundError{ID: image}
}
return resp, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment