Keep download count on Container tag overwrite (#20728)

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
KN4CK3R 2022-08-09 15:47:57 +02:00 committed by GitHub
parent 1b2cd4c4e1
commit 920481340b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -312,6 +312,9 @@ func createPackageAndVersion(ctx context.Context, mci *manifestCreationInfo, met
return nil, err
}
// keep download count on overwrite
_pv.DownloadCount = pv.DownloadCount
if pv, err = packages_model.GetOrInsertVersion(ctx, _pv); err != nil {
log.Error("Error inserting package: %v", err)
return nil, err