Skip to content

Enable DELETE on the Docker v2 blob endpoint#2380

Open
gerrod3 wants to merge 1 commit into
pulp:mainfrom
gerrod3:issue-481-blob-delete
Open

Enable DELETE on the Docker v2 blob endpoint#2380
gerrod3 wants to merge 1 commit into
pulp:mainfrom
gerrod3:issue-481-blob-delete

Conversation

@gerrod3

@gerrod3 gerrod3 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add DELETE /v2/<name>/blobs/<digest> to the registry API for push repositories
  • Pending blobs are removed immediately; committed blobs are removed via recursive_remove_content
  • Add functional tests for delete, not-found, invalid digest, and auth

Test plan

  • pytest pulp_container/tests/functional/api/test_delete_blob.py -v
  • Mount a blob to a push repo, DELETE it, confirm HEAD returns 404

Fixes #481

Made with Cursor

gerrod3 added a commit to gerrod3/pulp_container that referenced this pull request Jun 1, 2026
Fixes lint failure blocking CI on PR pulp#2380.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3

gerrod3 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

gerrod3 added a commit to gerrod3/pulp_container that referenced this pull request Jul 1, 2026
Fixes lint failure blocking CI on PR pulp#2380.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 force-pushed the issue-481-blob-delete branch from 05264ca to a9b8ff9 Compare July 1, 2026 14:42
gerrod3 added a commit to gerrod3/pulp_container that referenced this pull request Jul 7, 2026
Fixes lint failure blocking CI on PR pulp#2380.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 force-pushed the issue-481-blob-delete branch 2 times, most recently from fa0add0 to e2155f0 Compare July 7, 2026 20:43
@gerrod3 gerrod3 marked this pull request as ready for review July 7, 2026 21:08

return repository, blob.digest

def test_01_delete_invalid_digest(self, setup, local_registry, full_path):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with these numbers?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run the tests in a specific order. The fail cases and then the success case.

Comment thread pulp_container/app/registry_api.py Outdated
Comment on lines +1240 to +1241
if not blob:
pending_blob = repository.pending_blobs.filter(digest=pk).first()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer a single return statement.

Basically

if blob := ... :
    ...
elif blob := ... :
    ...
else:
    raise NotFound()
return Response(202)  # Accepted

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a blocking requirement...

Implement DELETE /v2/<name>/blobs/<digest> for push repositories,
with functional tests. Fixes pulp#481.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 force-pushed the issue-481-blob-delete branch from e2155f0 to 441e008 Compare July 8, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As a user I can delete a blob by digest via docker v2 api

2 participants