Merge pull request #6978 from cardyok/fix-tx-closed

This commit is contained in:
Fu Wei 2022-05-24 13:02:42 +08:00 committed by GitHub
commit 22e8fc1f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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