Skip to content

Add capability to limit the max number of results for oras repo ls and oras repo tags #1762

Description

@Wwwsylvia

What is the version of your ORAS CLI

v1.3.0-beta.3

What would you like to be added?

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?

  • Yes, I am willing to implement it.

Activity

  1. added
    enhancement
    triage
    spec required
    and removed
    triage
    on Jul 2, 2025
  2. added theissue type on Jul 2, 2025
  3. added this to the v1.4.0 milestone on Jul 2, 2025
  4. shizhMSFT commented on Jul 2, 2025

    @shizhMSFT
    Contributor

    Security: Helps prevent malicious servers from dumping excessive results, which could lead to an Out Of Memory (OOM) situation.

    The impact is none as the process is guarded by OOM killer and the impact is only scoped to non text format.

    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 3
  5. TerryHowe commented on Jul 2, 2025

    @TerryHowe
    Member

    json and templates space complexity is O(n) though and could be improved.

  6. tanyabhatnagar commented on Jul 3, 2025

    @tanyabhatnagar
    Contributor

    @Wwwsylvia @shizhMSFT @TerryHowe i would like to work on this issue, can you please assign it to me?

  7. shizhMSFT commented on Jul 4, 2025

    @shizhMSFT
    Contributor

    @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.

  8. TerryHowe commented on Oct 22, 2026

    @TerryHowe
    Member

    #1948 (printing every tag is hard to read for repositories with many tags) was closed as a duplicate of this issue.

  9. modified the milestones: v1.4.0, v1.5.0 on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementspec required

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions