Skip to content

Commit

Permalink
Merge pull request #8002 from thaJeztah/1.6_backport_fix_tx_closed
Browse files Browse the repository at this point in the history
[release/1.6 backport] Fix tx closed error when upperdirlabel specified
  • Loading branch information
estesp committed Jan 25, 2023
2 parents 8511d43 + 8c70403 commit 394f5ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions snapshots/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ func (o *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath
return snapshots.Info{}, err
}

if err := t.Commit(); err != nil {
return snapshots.Info{}, err
}

if o.upperdirLabel {
id, _, _, err := storage.GetInfo(ctx, info.Name)
if err != nil {
Expand All @@ -175,6 +171,10 @@ func (o *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath
info.Labels[upperdirKey] = o.upperPath(id)
}

if err := t.Commit(); err != nil {
return snapshots.Info{}, err
}

return info, nil
}

Expand Down

0 comments on commit 394f5ee

Please sign in to comment.