fix: support simultaneous create diff for same parent snapshot
Signed-off-by: Qian Zhang <cosmoer@qq.com>
This commit is contained in:
parent
d394e00c7e
commit
344431cdd4
@ -44,7 +44,7 @@ func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter
|
||||
return ocispec.Descriptor{}, err
|
||||
}
|
||||
|
||||
lowerKey := fmt.Sprintf("%s-parent-view", info.Parent)
|
||||
lowerKey := fmt.Sprintf("%s-parent-view-%s", info.Parent, uniquePart())
|
||||
lower, err := sn.View(ctx, lowerKey, info.Parent)
|
||||
if err != nil {
|
||||
return ocispec.Descriptor{}, err
|
||||
@ -58,7 +58,7 @@ func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter
|
||||
return ocispec.Descriptor{}, err
|
||||
}
|
||||
} else {
|
||||
upperKey := fmt.Sprintf("%s-view", snapshotID)
|
||||
upperKey := fmt.Sprintf("%s-view-%s", snapshotID, uniquePart())
|
||||
upper, err = sn.View(ctx, upperKey, snapshotID)
|
||||
if err != nil {
|
||||
return ocispec.Descriptor{}, err
|
||||
|
Loading…
Reference in New Issue
Block a user