1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

builder-next: clear temp leases on startup

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2019-10-21 23:15:56 -07:00
parent f632e2d8d3
commit 21dfcc730b
3 changed files with 9 additions and 3 deletions

View file

@ -75,8 +75,6 @@ func NewSnapshotter(opt Opt, prevLM leases.Manager) (snapshot.Snapshotter, lease
lm := newLeaseManager(s, prevLM)
// TODO: temp-leases
ll, err := lm.List(context.TODO())
if err != nil {
return nil, nil, err

View file

@ -1,6 +1,7 @@
package buildkit
import (
"context"
"net/http"
"os"
"path/filepath"
@ -166,6 +167,14 @@ func newController(rt http.RoundTripper, opt Opt) (*control.Controller, error) {
return nil, err
}
leases, err := lm.List(context.TODO(), "labels.\"buildkit/lease.temporary\"")
if err != nil {
return nil, err
}
for _, l := range leases {
lm.Delete(context.TODO(), l)
}
wopt := mobyworker.Opt{
ID: "moby",
MetadataStore: md,

View file

@ -59,7 +59,6 @@ type checker struct {
}
func (c *checker) Exists(key string, chain []digest.Digest) bool {
// TODO: neeeds update
if c.opt.ImageStore == nil {
return false
}