mirror of
https://github.com/moby/buildkit.git
synced 2026-08-09 01:01:08 +00:00
Merge pull request #3670 from imeoer/fix-panic-on-cache
fix a possible panic on cache
This commit is contained in:
6
cache/remote.go
vendored
6
cache/remote.go
vendored
@@ -228,13 +228,13 @@ func (sr *immutableRef) getRemote(ctx context.Context, createIfNeeded bool, refC
|
||||
newDesc.Size = blobDesc.Size
|
||||
newDesc.URLs = blobDesc.URLs
|
||||
newDesc.Annotations = nil
|
||||
if len(addAnnotations) > 0 || len(blobDesc.Annotations) > 0 {
|
||||
newDesc.Annotations = make(map[string]string)
|
||||
}
|
||||
for _, k := range addAnnotations {
|
||||
newDesc.Annotations[k] = desc.Annotations[k]
|
||||
}
|
||||
for k, v := range blobDesc.Annotations {
|
||||
if newDesc.Annotations == nil {
|
||||
newDesc.Annotations = make(map[string]string)
|
||||
}
|
||||
newDesc.Annotations[k] = v
|
||||
}
|
||||
desc = newDesc
|
||||
|
||||
Reference in New Issue
Block a user