|
@@ -24,6 +24,7 @@ import (
|
|
"github.com/moby/buildkit/executor"
|
|
"github.com/moby/buildkit/executor"
|
|
"github.com/moby/buildkit/exporter"
|
|
"github.com/moby/buildkit/exporter"
|
|
"github.com/moby/buildkit/frontend"
|
|
"github.com/moby/buildkit/frontend"
|
|
|
|
+ gw "github.com/moby/buildkit/frontend/gateway/client"
|
|
"github.com/moby/buildkit/session"
|
|
"github.com/moby/buildkit/session"
|
|
"github.com/moby/buildkit/snapshot"
|
|
"github.com/moby/buildkit/snapshot"
|
|
"github.com/moby/buildkit/solver"
|
|
"github.com/moby/buildkit/solver"
|
|
@@ -141,7 +142,7 @@ func (w *Worker) ResolveOp(v solver.Vertex, s frontend.FrontendLLBBridge) (solve
|
|
case *pb.Op_Source:
|
|
case *pb.Op_Source:
|
|
return ops.NewSourceOp(v, op, baseOp.Platform, w.SourceManager, w)
|
|
return ops.NewSourceOp(v, op, baseOp.Platform, w.SourceManager, w)
|
|
case *pb.Op_Exec:
|
|
case *pb.Op_Exec:
|
|
- return ops.NewExecOp(v, op, w.CacheManager, w.MetadataStore, w.Executor, w)
|
|
|
|
|
|
+ return ops.NewExecOp(v, op, w.CacheManager, w.Opt.SessionManager, w.MetadataStore, w.Executor, w)
|
|
case *pb.Op_Build:
|
|
case *pb.Op_Build:
|
|
return ops.NewBuildOp(v, op, s, w)
|
|
return ops.NewBuildOp(v, op, s, w)
|
|
}
|
|
}
|
|
@@ -150,13 +151,13 @@ func (w *Worker) ResolveOp(v solver.Vertex, s frontend.FrontendLLBBridge) (solve
|
|
}
|
|
}
|
|
|
|
|
|
// ResolveImageConfig returns image config for an image
|
|
// ResolveImageConfig returns image config for an image
|
|
-func (w *Worker) ResolveImageConfig(ctx context.Context, ref string, platform *ocispec.Platform) (digest.Digest, []byte, error) {
|
|
|
|
|
|
+func (w *Worker) ResolveImageConfig(ctx context.Context, ref string, opt gw.ResolveImageConfigOpt) (digest.Digest, []byte, error) {
|
|
// ImageSource is typically source/containerimage
|
|
// ImageSource is typically source/containerimage
|
|
resolveImageConfig, ok := w.ImageSource.(resolveImageConfig)
|
|
resolveImageConfig, ok := w.ImageSource.(resolveImageConfig)
|
|
if !ok {
|
|
if !ok {
|
|
return "", nil, errors.Errorf("worker %q does not implement ResolveImageConfig", w.ID())
|
|
return "", nil, errors.Errorf("worker %q does not implement ResolveImageConfig", w.ID())
|
|
}
|
|
}
|
|
- return resolveImageConfig.ResolveImageConfig(ctx, ref, platform)
|
|
|
|
|
|
+ return resolveImageConfig.ResolveImageConfig(ctx, ref, opt)
|
|
}
|
|
}
|
|
|
|
|
|
// Exec executes a process directly on a worker
|
|
// Exec executes a process directly on a worker
|
|
@@ -175,8 +176,8 @@ func (w *Worker) DiskUsage(ctx context.Context, opt client.DiskUsageInfo) ([]*cl
|
|
}
|
|
}
|
|
|
|
|
|
// Prune deletes reclaimable build cache
|
|
// Prune deletes reclaimable build cache
|
|
-func (w *Worker) Prune(ctx context.Context, ch chan client.UsageInfo) error {
|
|
|
|
- return w.CacheManager.Prune(ctx, ch)
|
|
|
|
|
|
+func (w *Worker) Prune(ctx context.Context, ch chan client.UsageInfo, info client.PruneInfo) error {
|
|
|
|
+ return w.CacheManager.Prune(ctx, ch, info)
|
|
}
|
|
}
|
|
|
|
|
|
// Exporter returns exporter by name
|
|
// Exporter returns exporter by name
|
|
@@ -327,5 +328,5 @@ func oneOffProgress(ctx context.Context, id string) func(err error) error {
|
|
}
|
|
}
|
|
|
|
|
|
type resolveImageConfig interface {
|
|
type resolveImageConfig interface {
|
|
- ResolveImageConfig(ctx context.Context, ref string, platform *ocispec.Platform) (digest.Digest, []byte, error)
|
|
|
|
|
|
+ ResolveImageConfig(ctx context.Context, ref string, opt gw.ResolveImageConfigOpt) (digest.Digest, []byte, error)
|
|
}
|
|
}
|