Skip to content

Enable DELETE on the Docker v2 manifest endpoint#2377

Open
gerrod3 wants to merge 8 commits into
pulp:mainfrom
gerrod3:cursor/c71cc96a
Open

Enable DELETE on the Docker v2 manifest endpoint#2377
gerrod3 wants to merge 8 commits into
pulp:mainfrom
gerrod3:cursor/c71cc96a

Conversation

@gerrod3
Copy link
Copy Markdown
Contributor

@gerrod3 gerrod3 commented Jun 1, 2026

Summary

  • Add DELETE /v2/<name>/manifests/<digest> support to the registry API
  • Recursively remove the manifest, its tags, and related content from push repositories
  • Add functional tests for delete-by-digest, tag rejection, not-found, and auth failures

Test plan

  • Push an image to a push repository
  • Delete the manifest by digest and verify 202 Accepted
  • Confirm the image/tag is no longer pullable
  • Verify delete by tag name returns 400 INVALID_REQUEST
  • Verify delete without auth returns 401

Made with Cursor

Allow users to delete manifests by digest via the registry API, with
recursive removal of related tags and content from push repositories.

fixes: pulp#480
Co-authored-by: Cursor <cursoragent@cursor.com>
Obtain the manifest digest via HEAD instead of inspect after push, since
tag_and_push removes the local image. Poll until the manifest is gone
after delete because removal runs asynchronously.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wait for the pushed manifest to appear before reading its digest, and
send unauthenticated DELETE requests directly instead of via get_response.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 linked an issue Jun 1, 2026 that may be closed by this pull request
Wait for the pushed tag via repository API instead of registry HEAD,
which is unreliable during async push completion in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3
Copy link
Copy Markdown
Contributor Author

gerrod3 commented Jun 1, 2026

gerrod3 and others added 4 commits June 1, 2026 17:16
Resolve manifests through repository tags when they are not directly
present in the repository version, and tighten functional test setup.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid picking up CI netrc credentials by disabling trust_env when
sending an unauthenticated DELETE request.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use gen_user and local_registry.get_response like other RBAC registry
tests instead of raw requests.delete with trust_env, which is invalid
and could authenticate as admin via RemoteUser in CI.

fixes: pulp#480
Co-authored-by: Cursor <cursoragent@cursor.com>
Users without push permissions may receive 403 Forbidden instead of
401 Unauthorized depending on the storage backend configuration.

fixes: pulp#480
Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 marked this pull request as ready for review June 1, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant