Skip to content

Feature: "Top Largest" Mode (Disk Space Priority) #2

@tejaswankalluri

Description

@tejaswankalluri

Problem:
Users often need to free up a specific amount of disk space immediately (e.g., 5GB) without worrying about the age of the resources. The current tool doesn't support prioritizing cleanup based on size.

Proposed Solution:
Add a "Top Largest" mode to prioritize cleaning the largest resources first.

Requirements:

  1. New Flags:

    • --limit-space <size>: Clean resources until the specified amount of space is reclaimed (e.g., 5GB, 500MB).
    • --top <number>: Select the top N largest resources to clean.
  2. Logic:

    • Sort scan results by size in descending order.
    • Select items starting from the largest until the criteria (space limit or count limit) is met.
  3. Implementation Details:

    • Reuse existing size string parsing logic in src/docker.ts.
    • Implement sorting and selection logic in src/scan.ts.
    • Ensure the summary and confirmation prompts reflect the selected subset of resources.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions