mirror of
https://github.com/moby/buildkit.git
synced 2026-06-30 19:57:39 +00:00
cache: make sure mutable refs are not finalized on exporting cache
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
8
cache/blobs.go
vendored
8
cache/blobs.go
vendored
@@ -36,6 +36,14 @@ func (sr *immutableRef) computeBlobChain(ctx context.Context, createIfNeeded boo
|
||||
if _, ok := leases.FromContext(ctx); !ok {
|
||||
return errors.Errorf("missing lease requirement for computeBlobChain")
|
||||
}
|
||||
if !createIfNeeded {
|
||||
sr.mu.Lock()
|
||||
if sr.equalMutable != nil {
|
||||
sr.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
sr.mu.Unlock()
|
||||
}
|
||||
|
||||
if err := sr.Finalize(ctx); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user