distribution-spec icon indicating copy to clipboard operation
distribution-spec copied to clipboard

Proposal: search repository and filter by ordered property, prune by ordered property

Open whatsacomputertho opened this issue 4 months ago • 1 comments

Background

I worked on custom tooling for pruning a repository by created date and by semver

  • https://github.com/IBM/image-prune

I proposed this as a new feature in skopeo which was denied in part due to the large number of HTTP requests that are required to achieve this today when using the standard distribution API endpoints.

  • https://github.com/containers/skopeo/pull/2656

Proposal

Tag list filtering

I would like to propose the addition of query parameters on the image tag list endpoint to support filtering the list of tags before an ordered property of the manifest.

GET /v2/<name>/tags/list

It should support filtering by created date

?before_time="<rfc-3339-timestamp>"

It should support filtering by tag semver

?before_version="<semver>"&include_invalid="<bool-default-false>"

It should support filtering by label semver

?before_version="<semver>"&version_label="<label-name>"&include_invalid="<bool-default-false>"

Pruning

I would also like to propose the addition of a new endpoint which supports the same tag list filtering query parameters as above, but deletes the manifests which fall prior to the given threshold.

DELETE /v2/<name>/prune

whatsacomputertho avatar Aug 17 '25 22:08 whatsacomputertho

See #579 for a proposed addition to the tag listing API.

sudo-bmitch avatar Aug 17 '25 22:08 sudo-bmitch