builder: changes needed since buildkit 0.10.0

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-03-23 16:06:52 +01:00
parent a2aaf4cc83
commit aadb3bf766
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 13 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import (
"strings"
"sync"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/snapshots"
@ -198,7 +199,7 @@ func (s *snapshotter) getGraphDriverID(key string) (string, bool) {
if err := s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte(key))
if b == nil {
return errors.Errorf("not found") // TODO: typed
return errors.Wrapf(errdefs.ErrNotFound, "key %s", key)
}
v := b.Get(keyCommitted)
if v != nil {
@ -242,7 +243,7 @@ func (s *snapshotter) Stat(ctx context.Context, key string) (snapshots.Info, err
if err := s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte(id))
if b == nil && l == nil {
return errors.Errorf("snapshot %s not found", id) // TODO: typed
return errors.Wrapf(errdefs.ErrNotFound, "snapshot %s", id)
}
inf.Name = key
if b != nil {

View file

@ -12,6 +12,7 @@ import (
"github.com/docker/docker/reference"
"github.com/moby/buildkit/exporter"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
"github.com/moby/buildkit/util/compression"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
)
@ -69,7 +70,11 @@ func (e *imageExporterInstance) Name() string {
}
func (e *imageExporterInstance) Config() exporter.Config {
return exporter.Config{}
return exporter.Config{
Compression: compression.Config{
Type: compression.Default,
},
}
}
func (e *imageExporterInstance) Export(ctx context.Context, inp exporter.Source, sessionID string) (map[string]string, error) {

View file

@ -185,6 +185,10 @@ func (w *Worker) ResolveOp(v solver.Vertex, s frontend.FrontendLLBBridge, sm *se
return ops.NewFileOp(v, op, w.CacheManager(), parallelism, w)
case *pb.Op_Build:
return ops.NewBuildOp(v, op, s, w)
case *pb.Op_Merge:
return ops.NewMergeOp(v, op, w)
case *pb.Op_Diff:
return ops.NewDiffOp(v, op, w)
}
}
return nil, errors.Errorf("could not resolve %v", v)