Skip to content

Commit bb96b21

Browse files
cosmoervvoland
authored andcommitted
fix: support simultaneous create diff for same parent snapshot
Signed-off-by: Qian Zhang <[email protected]> (cherry picked from commit 344431c) Signed-off-by: Paweł Gronowski <[email protected]>
1 parent 92ee926 commit bb96b21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rootfs/diff.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter
4444
return ocispec.Descriptor{}, err
4545
}
4646

47-
lowerKey := fmt.Sprintf("%s-parent-view", info.Parent)
47+
lowerKey := fmt.Sprintf("%s-parent-view-%s", info.Parent, uniquePart())
4848
lower, err := sn.View(ctx, lowerKey, info.Parent)
4949
if err != nil {
5050
return ocispec.Descriptor{}, err
@@ -58,7 +58,7 @@ func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter
5858
return ocispec.Descriptor{}, err
5959
}
6060
} else {
61-
upperKey := fmt.Sprintf("%s-view", snapshotID)
61+
upperKey := fmt.Sprintf("%s-view-%s", snapshotID, uniquePart())
6262
upper, err = sn.View(ctx, upperKey, snapshotID)
6363
if err != nil {
6464
return ocispec.Descriptor{}, err

0 commit comments

Comments
 (0)