feature: Allow using expressions for filtering prune operations
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Currently is not possible to execute prune operations using filters to exclude with "OR" logic.
Assume one would like docker system prune to exclude all resources with either one of these labels:
io.kubernetes.container.name=name-01
io.kubernetes.container.name=name-02
Executing docker system prune -f --volumes --filter "label!=io.kubernetes.container.name=name-01" --filter "label!=io.kubernetes.container.name=name-02" will result only in resources with both labels (AND) being excluded from the prune operation instead of resulting in a prune operation that filters out one or (OR) the other, prunning everything except those resources with any of those labels.
Having the possibility at least to use regex or go templating to pass filters would be desired.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The linked entry point is cli/command/system/prune.go around line 131; start by tracing how repeated label filters are passed to prune operations. Define the supported expression or filter behavior, then verify that resources matching either listed label are excluded while existing filtering continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100