From 8fdf84f82181c897e10fd4c83b10adae6781c81f Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 15 Aug 2024 13:24:51 +0300 Subject: [PATCH] remotecache: handle not implemented error for Info() Moby graphdriver backend does not implement Info() and such case should not be used as a signal for blob needed to be skipped as it is unavailable. This requires a change in Moby side as well to return a typed error instead of string. Signed-off-by: Tonis Tiigi --- cache/remotecache/v1/utils.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cache/remotecache/v1/utils.go b/cache/remotecache/v1/utils.go index 79cf846391fe..ef0294d75f18 100644 --- a/cache/remotecache/v1/utils.go +++ b/cache/remotecache/v1/utils.go @@ -5,6 +5,7 @@ import ( "fmt" "sort" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/solver" "github.com/moby/buildkit/util/bklog" digest "github.com/opencontainers/go-digest" @@ -281,7 +282,9 @@ func marshalRemote(ctx context.Context, r *solver.Remote, state *marshalState) s if r.Provider != nil { for _, d := range r.Descriptors { if _, err := r.Provider.Info(ctx, d.Digest); err != nil { - return "" + if !cerrdefs.IsNotImplemented(err) { + return "" + } } } }