diff options
author | Tonis Tiigi <tonistiigi@gmail.com> | 2023-02-03 10:38:07 -0800 |
---|---|---|
committer | Tonis Tiigi <tonistiigi@gmail.com> | 2023-02-07 10:24:36 -0800 |
commit | 335907d1878ffc33dccd45cc8121b1f10e900157 (patch) | |
tree | 3b25c613378b9b8868ae3bea7541cd74939c1ec8 /builder | |
parent | 5f369ff1d4c8cc2162f865d11f2fbcd5d612013d (diff) | |
download | docker-335907d1878ffc33dccd45cc8121b1f10e900157.tar.gz |
builder: define GetRemotes for the worker
The function signature has changed since v0.10.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Diffstat (limited to 'builder')
-rw-r--r-- | builder/builder-next/worker/worker.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/builder/builder-next/worker/worker.go b/builder/builder-next/worker/worker.go index 59934a2112..d0c04ac605 100644 --- a/builder/builder-next/worker/worker.go +++ b/builder/builder-next/worker/worker.go @@ -19,6 +19,7 @@ import ( "github.com/docker/docker/layer" pkgprogress "github.com/docker/docker/pkg/progress" "github.com/moby/buildkit/cache" + cacheconfig "github.com/moby/buildkit/cache/config" "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/executor" @@ -37,7 +38,6 @@ import ( "github.com/moby/buildkit/source/http" "github.com/moby/buildkit/source/local" "github.com/moby/buildkit/util/archutil" - "github.com/moby/buildkit/util/compression" "github.com/moby/buildkit/util/contentutil" "github.com/moby/buildkit/util/progress" "github.com/moby/buildkit/version" @@ -86,6 +86,10 @@ type Worker struct { SourceManager *source.Manager } +var _ interface { + GetRemotes(context.Context, cache.ImmutableRef, bool, cacheconfig.RefConfig, bool, session.Group) ([]*solver.Remote, error) +} = &Worker{} + // NewWorker instantiates a local worker func NewWorker(opt Opt) (*Worker, error) { sm, err := source.NewManager() @@ -259,8 +263,11 @@ func (w *Worker) Exporter(name string, sm *session.Manager) (exporter.Exporter, } } -// GetRemote returns a remote snapshot reference for a local one -func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool, _ compression.Type, s session.Group) (*solver.Remote, error) { +// GetRemotes returns the remote snapshot references given a local reference +func (w *Worker) GetRemotes(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool, _ cacheconfig.RefConfig, all bool, s session.Group) ([]*solver.Remote, error) { + if ref == nil { + return nil, nil + } var diffIDs []layer.DiffID var err error if !createIfNeeded { @@ -290,10 +297,10 @@ func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIf } } - return &solver.Remote{ + return []*solver.Remote{{ Descriptors: descriptors, Provider: &emptyProvider{}, - }, nil + }}, nil } // PruneCacheMounts removes the current cache snapshots for specified IDs |