You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add capability to limit the max number of results for oras repo ls and oras repo tags #1762
We should consider adding a flag to the oras repo ls and oras repo tags commands to limit the maximum number of results returned. This flag would allow users to specify a maximum number of results, preventing the client from being overwhelmed by too many results.
Why is this needed for ORAS?
Security: Helps prevent malicious servers from dumping excessive results, which could lead to an Out Of Memory (OOM) situation.
Usability: When using --json format, users see nothing until the entire result is loaded and rendered. Limiting results improves performance when only the first N tags are needed.
Are you willing to submit PRs to contribute to this feature?
@tanyabhatnagar Thanks for offering the contribution! As the labels mentioned, it requires spec proposal before the actual implementation. You are welcome to contribute to the design spec. Once the spec is finalized (for larger features) or the discussion is closed with a consensus (for smaller features), we can proceed to implementation. Otherwise, all related PRs are treated as drafts or demos.
Activity
shizhMSFT commentedon Jul 2, 2025
The impact is none as the process is guarded by OOM killer and the impact is only scoped to non
textformat.For text format, which is the default format, the memory usage is$O(1)$ . The maximum number of results can be limited by
head -n. For example,oras repo tags ghcr.io/oras-project/oras --last v1.0.0 | head -n 3TerryHowe commentedon Jul 2, 2025
json and templates space complexity is O(n) though and could be improved.
tanyabhatnagar commentedon Jul 3, 2025
@Wwwsylvia @shizhMSFT @TerryHowe i would like to work on this issue, can you please assign it to me?
feat(repo): add --limit flag to repo ls and tags (oras-project#1762)
shizhMSFT commentedon Jul 4, 2025
@tanyabhatnagar Thanks for offering the contribution! As the labels mentioned, it requires spec proposal before the actual implementation. You are welcome to contribute to the design spec. Once the spec is finalized (for larger features) or the discussion is closed with a consensus (for smaller features), we can proceed to implementation. Otherwise, all related PRs are treated as drafts or demos.
TerryHowe commentedon Oct 22, 2026
#1948 (printing every tag is hard to read for repositories with many tags) was closed as a duplicate of this issue.