@@ -18,6 +18,7 @@ import (
1818 "github.com/docker/docker/layer"
1919 pkgprogress "github.com/docker/docker/pkg/progress"
2020 "github.com/moby/buildkit/cache"
21+ cacheconfig "github.com/moby/buildkit/cache/config"
2122 "github.com/moby/buildkit/client"
2223 "github.com/moby/buildkit/client/llb"
2324 "github.com/moby/buildkit/executor"
@@ -36,7 +37,6 @@ import (
3637 "github.com/moby/buildkit/source/http"
3738 "github.com/moby/buildkit/source/local"
3839 "github.com/moby/buildkit/util/archutil"
39- "github.com/moby/buildkit/util/compression"
4040 "github.com/moby/buildkit/util/contentutil"
4141 "github.com/moby/buildkit/util/progress"
4242 "github.com/opencontainers/go-digest"
@@ -79,6 +79,10 @@ type Worker struct {
7979 SourceManager * source.Manager
8080}
8181
82+ var _ interface {
83+ GetRemotes (context.Context , cache.ImmutableRef , bool , cacheconfig.RefConfig , bool , session.Group ) ([]* solver.Remote , error )
84+ } = & Worker {}
85+
8286// NewWorker instantiates a local worker
8387func NewWorker (opt Opt ) (* Worker , error ) {
8488 sm , err := source .NewManager ()
@@ -227,8 +231,11 @@ func (w *Worker) Exporter(name string, sm *session.Manager) (exporter.Exporter,
227231 }
228232}
229233
230- // GetRemote returns a remote snapshot reference for a local one
231- func (w * Worker ) GetRemote (ctx context.Context , ref cache.ImmutableRef , createIfNeeded bool , _ compression.Type , s session.Group ) (* solver.Remote , error ) {
234+ // GetRemotes returns the remote snapshot references given a local reference
235+ func (w * Worker ) GetRemotes (ctx context.Context , ref cache.ImmutableRef , createIfNeeded bool , _ cacheconfig.RefConfig , all bool , s session.Group ) ([]* solver.Remote , error ) {
236+ if ref == nil {
237+ return nil , nil
238+ }
232239 var diffIDs []layer.DiffID
233240 var err error
234241 if ! createIfNeeded {
@@ -258,10 +265,10 @@ func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIf
258265 }
259266 }
260267
261- return & solver.Remote {
268+ return [] * solver.Remote { {
262269 Descriptors : descriptors ,
263270 Provider : & emptyProvider {},
264- }, nil
271+ }} , nil
265272}
266273
267274// PruneCacheMounts removes the current cache snapshots for specified IDs
0 commit comments