Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fix container push #33214

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions routers/api/packages/container/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@
return nil, err
}

if err = packages_service.DeletePackageVersionAndReferences(ctx, pv); err != nil {
return nil, err
}

// keep download count on overwrite
_pv.DownloadCount = pv.DownloadCount

Expand Down Expand Up @@ -400,7 +396,7 @@
IsLead bool
}

func createFileFromBlobReference(ctx context.Context, pv, uploadVersion *packages_model.PackageVersion, ref *blobReference) error {

Check failure on line 399 in routers/api/packages/container/manifest.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

`createFileFromBlobReference` - `uploadVersion` is unused (unparam)

Check failure on line 399 in routers/api/packages/container/manifest.go

View workflow job for this annotation

GitHub Actions / lint-backend

`createFileFromBlobReference` - `uploadVersion` is unused (unparam)

Check failure on line 399 in routers/api/packages/container/manifest.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

`createFileFromBlobReference` - `uploadVersion` is unused (unparam)
if ref.File.Blob.Size != ref.ExpectedSize {
return errSizeInvalid
}
Expand All @@ -418,12 +414,10 @@
}
var err error
if pf, err = packages_model.TryInsertFile(ctx, pf); err != nil {
if errors.Is(err, packages_model.ErrDuplicatePackageFile) {
// Skip this blob because the manifest contains the same filesystem layer multiple times.
return nil
if !errors.Is(err, packages_model.ErrDuplicatePackageFile) {
log.Error("Error inserting package file: %v", err)
return err
}
log.Error("Error inserting package file: %v", err)
return err
}

props := map[string]string{
Expand All @@ -437,13 +431,6 @@
}
}

// Remove the file from the blob upload version
if uploadVersion != nil && ref.File.File != nil && uploadVersion.ID == ref.File.File.VersionID {
if err := packages_service.DeletePackageFile(ctx, ref.File.File); err != nil {
return err
}
}

return nil
}

Expand Down
Loading