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:
parent
f632e2d8d3
commit
21dfcc730b
3 changed files with 9 additions and 3 deletions
|
@ -75,8 +75,6 @@ func NewSnapshotter(opt Opt, prevLM leases.Manager) (snapshot.Snapshotter, lease
|
||||||
|
|
||||||
lm := newLeaseManager(s, prevLM)
|
lm := newLeaseManager(s, prevLM)
|
||||||
|
|
||||||
// TODO: temp-leases
|
|
||||||
|
|
||||||
ll, err := lm.List(context.TODO())
|
ll, err := lm.List(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package buildkit
|
package buildkit
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -166,6 +167,14 @@ func newController(rt http.RoundTripper, opt Opt) (*control.Controller, error) {
|
||||||
return nil, err
|
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{
|
wopt := mobyworker.Opt{
|
||||||
ID: "moby",
|
ID: "moby",
|
||||||
MetadataStore: md,
|
MetadataStore: md,
|
||||||
|
|
|
@ -59,7 +59,6 @@ type checker struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *checker) Exists(key string, chain []digest.Digest) bool {
|
func (c *checker) Exists(key string, chain []digest.Digest) bool {
|
||||||
// TODO: neeeds update
|
|
||||||
if c.opt.ImageStore == nil {
|
if c.opt.ImageStore == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue