mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@cbfd4023383d
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
24
vendor/github.com/moby/buildkit/util/contentutil/storewithprovider.go
generated
vendored
Normal file
24
vendor/github.com/moby/buildkit/util/contentutil/storewithprovider.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package contentutil
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/containerd/containerd/content"
|
||||
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
func NewStoreWithProvider(cs content.Store, p content.Provider) content.Store {
|
||||
return &storeWithProvider{Store: cs, p: p}
|
||||
}
|
||||
|
||||
type storeWithProvider struct {
|
||||
content.Store
|
||||
p content.Provider
|
||||
}
|
||||
|
||||
func (cs *storeWithProvider) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) {
|
||||
if ra, err := cs.p.ReaderAt(ctx, desc); err == nil {
|
||||
return ra, nil
|
||||
}
|
||||
return cs.Store.ReaderAt(ctx, desc)
|
||||
}
|
Reference in New Issue
Block a user