daemon/list: Replace ErrImageDoesNotExist check
Check for generic `errdefs.NotFound` rather than specific error helper
struct when checking if the error is caused by the image not being
present.
It still works for `ErrImageDoesNotExist` because it
implements the NotFound errdefs interface too.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 5a39bee635
)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
3029f554cc
commit
fcb68e55fa
1 changed files with 1 additions and 2 deletions
|
@ -11,7 +11,6 @@ import (
|
|||
"github.com/docker/docker/api/types/filters"
|
||||
imagetypes "github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/container"
|
||||
"github.com/docker/docker/daemon/images"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/go-connections/nat"
|
||||
|
@ -585,7 +584,7 @@ func (daemon *Daemon) refreshImage(ctx context.Context, s *container.Snapshot, f
|
|||
tmpImage := s.Image // keep the original ref if still valid (hasn't changed)
|
||||
if tmpImage != s.ImageID {
|
||||
img, err := daemon.imageService.GetImage(ctx, tmpImage, imagetypes.GetImageOpts{})
|
||||
if _, isDNE := err.(images.ErrImageDoesNotExist); err != nil && !isDNE {
|
||||
if err != nil && !errdefs.IsNotFound(err) {
|
||||
return nil, err
|
||||
}
|
||||
if err != nil || img.ImageID() != s.ImageID {
|
||||
|
|
Loading…
Add table
Reference in a new issue