|
@@ -85,8 +85,9 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach
|
|
r CacheExporterRecord
|
|
r CacheExporterRecord
|
|
selector digest.Digest
|
|
selector digest.Digest
|
|
}
|
|
}
|
|
|
|
+ k := e.k.clone() // protect against *CacheKey internal ids mutation from other exports
|
|
|
|
|
|
- recKey := rootKey(e.k.Digest(), e.k.Output())
|
|
|
|
|
|
+ recKey := rootKey(k.Digest(), k.Output())
|
|
rec := t.Add(recKey)
|
|
rec := t.Add(recKey)
|
|
allRec := []CacheExporterRecord{rec}
|
|
allRec := []CacheExporterRecord{rec}
|
|
|
|
|
|
@@ -97,7 +98,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach
|
|
}
|
|
}
|
|
|
|
|
|
exportRecord := opt.ExportRoots
|
|
exportRecord := opt.ExportRoots
|
|
- if len(e.k.Deps()) > 0 {
|
|
|
|
|
|
+ if len(deps) > 0 {
|
|
exportRecord = true
|
|
exportRecord = true
|
|
}
|
|
}
|
|
|
|
|
|
@@ -126,7 +127,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach
|
|
if opt.CompressionOpt != nil {
|
|
if opt.CompressionOpt != nil {
|
|
for _, r := range remotes { // record all remaining remotes as well
|
|
for _, r := range remotes { // record all remaining remotes as well
|
|
rec := t.Add(recKey)
|
|
rec := t.Add(recKey)
|
|
- rec.AddResult(e.k.vtx, int(e.k.output), v.CreatedAt, r)
|
|
|
|
|
|
+ rec.AddResult(k.vtx, int(k.output), v.CreatedAt, r)
|
|
variants = append(variants, rec)
|
|
variants = append(variants, rec)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -147,7 +148,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach
|
|
if opt.CompressionOpt != nil {
|
|
if opt.CompressionOpt != nil {
|
|
for _, r := range remotes { // record all remaining remotes as well
|
|
for _, r := range remotes { // record all remaining remotes as well
|
|
rec := t.Add(recKey)
|
|
rec := t.Add(recKey)
|
|
- rec.AddResult(e.k.vtx, int(e.k.output), v.CreatedAt, r)
|
|
|
|
|
|
+ rec.AddResult(k.vtx, int(k.output), v.CreatedAt, r)
|
|
variants = append(variants, rec)
|
|
variants = append(variants, rec)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -155,7 +156,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach
|
|
|
|
|
|
if remote != nil {
|
|
if remote != nil {
|
|
for _, rec := range allRec {
|
|
for _, rec := range allRec {
|
|
- rec.AddResult(e.k.vtx, int(e.k.output), v.CreatedAt, remote)
|
|
|
|
|
|
+ rec.AddResult(k.vtx, int(k.output), v.CreatedAt, remote)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
allRec = append(allRec, variants...)
|
|
allRec = append(allRec, variants...)
|
|
@@ -198,7 +199,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- for cm, id := range e.k.ids {
|
|
|
|
|
|
+ for cm, id := range k.ids {
|
|
if _, err := addBacklinks(t, rec, cm, id, bkm); err != nil {
|
|
if _, err := addBacklinks(t, rec, cm, id, bkm); err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|