Skip to content

Commit

Permalink
fix: support simultaneous create diff for same parent snapshot
Browse files Browse the repository at this point in the history
Signed-off-by: Qian Zhang <cosmoer@qq.com>
  • Loading branch information
cosmoer committed Jul 24, 2022
1 parent d394e00 commit 344431c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rootfs/diff.go
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 344431c

Please sign in to comment.