-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem:
The current cleanup logic is broad (based on age or type). Users often have specific "pet" resources (e.g., a stopped postgres container with development data, or a base image) that they never want to delete, even if it falls within the cleanup criteria. Currently, they have to clean manually or risk losing these resources.
Proposed Solution:
Add an --exclude <pattern> flag that allows users to specify patterns for resources to be ignored during the scan and clean process.
Requirements:
- Multiple Exclusions: Support multiple flags in one command.
- Example:
docklean --all --exclude "prod-*" --exclude "my-local-db"
- Example:
- Pattern Matching: Support standard glob patterns (e.g.,
*,?) or regex for flexible matching against resource names/IDs. - Scope: The exclusion should apply to all resource types being scanned (Containers, Images, Volumes, Networks).
Expected Outcome:
- Resources matching the provided patterns are completely omitted from the scan results.
- These resources are never removed, regardless of their age or status.
- The summary output should ideally (optional but nice) mention that some items were excluded by user request.
Implementation Hints:
- Update
src/args.tsto parse--excludeas a string array. - Update
src/scan.tsto filter items immediately after fetching from Docker, before applying age filters.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request