1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
package llbsolver
import (
"context"
cacheconfig "github.com/moby/buildkit/cache/config"
"github.com/moby/buildkit/frontend"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/solver"
"github.com/moby/buildkit/solver/llbsolver/provenance"
"github.com/moby/buildkit/worker"
"github.com/pkg/errors"
)
type Result struct {
*frontend.Result
Provenance *provenance.Result
}
type Attestation = frontend.Attestation
func workerRefResolver(refCfg cacheconfig.RefConfig, all bool, g session.Group) func(ctx context.Context, res solver.Result) ([]*solver.Remote, error) {
return func(ctx context.Context, res solver.Result) ([]*solver.Remote, error) {
ref, ok := res.Sys().(*worker.WorkerRef)
if !ok {
return nil, errors.Errorf("invalid result: %T", res.Sys())
}
return ref.GetRemotes(ctx, true, refCfg, all, g)
}
}
|