mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
builder: fix pruning all cache
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
8ff7847d1c
commit
d47435a004
2 changed files with 11 additions and 0 deletions
|
@ -516,6 +516,15 @@ func (p *puller) Snapshot(ctx context.Context) (cache.ImmutableRef, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// TODO: handle windows layers for cross platform builds
|
||||
|
||||
if p.src.RecordType != "" && cache.GetRecordType(ref) == "" {
|
||||
if err := cache.SetRecordType(ref, p.src.RecordType); err != nil {
|
||||
ref.Release(context.TODO())
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return ref, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@ func newController(rt http.RoundTripper, opt Opt) (*control.Controller, error) {
|
|||
cm, err := cache.NewManager(cache.ManagerOpt{
|
||||
Snapshotter: snapshotter,
|
||||
MetadataStore: md,
|
||||
// TODO: implement PruneRefChecker to correctly mark cache objects as "Shared"
|
||||
PruneRefChecker: nil,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Reference in a new issue