Skip to content

Commit

Permalink
remotecache: handle not implemented error for Info()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tonistiigi committed Aug 15, 2024
1 parent bff1d81 commit 8fdf84f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cache/remotecache/v1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ""
}
}
}
}
Expand Down

0 comments on commit 8fdf84f

Please sign in to comment.