From 81668187918389c06b30691cff58c61df54a54b3 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 20 Oct 2023 16:52:25 +0200 Subject: [PATCH] c8d: Return the "tag does not exist error" In the tagged case the error message when the image/tag is not found should be "tag does not exist: ref" Signed-off-by: Djordje Lukic --- daemon/containerd/image_push.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/containerd/image_push.go b/daemon/containerd/image_push.go index 1ef2627bf6050..ccd53aeeae036 100644 --- a/daemon/containerd/image_push.go +++ b/daemon/containerd/image_push.go @@ -89,6 +89,9 @@ func (i *ImageService) pushRef(ctx context.Context, targetRef reference.Named, m img, err := i.client.ImageService().Get(ctx, targetRef.String()) if err != nil { + if cerrdefs.IsNotFound(err) { + return errdefs.NotFound(fmt.Errorf("tag does not exist: %s", reference.FamiliarString(targetRef))) + } return errdefs.NotFound(err) }