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>
(cherry picked from commit 344431c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
  • Loading branch information
cosmoer authored and vvoland committed Dec 5, 2022
1 parent 92ee926 commit bb96b21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rootfs/diff.go
Original file line number Diff line number Diff line change
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 bb96b21

Please sign in to comment.