Inconsistent behavior between `label` and `label!` filters in `volume prune`
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Bắt đầu tại điểm vào của Docker CLI cho docker volume prune và theo dõi cách các bộ lọc label và label!= lặp lại được đánh giá. Tái hiện các lệnh trong issue, sau đó kiểm tra các bài kiểm thử bộ lọc liên quan nếu có và bổ sung phạm vi kiểm thử hồi quy cho thấy hành vi nhất quán được mong đợi đối với cả hai dạng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
In docker volume prune, label filters are combined with AND, while label! filters are combined with OR. This seems unexpected, and is not mentioned in the documentation, so I assume it to be a bug.
Reproduce
docker volume create --label a=b --label b=c vol1 && docker volume create --label a=b --label b=c --label d=e vol2 && docker volume create --label b=c --label c=d vol3
docker volume prune --all --filter label=a=b --filter label=y=y
*no deleted volumes*
docker volume prune --all --filter label!=a=b --filter label!=y=y
Deleted Volumes:
vol1
vol2
vol3
Expected behavior
I would expect the same logical operation to be used in both cases. By reading only remove volumes with (or without, in case label!=... is used) the specified labels, AND makes more sense, so I would not expect vol1 and vol2 being deleted in the label! example, as they do have the a=b label.
docker version
Client:
Version: 29.3.1
API version: 1.54
Go version: go1.25.8 X:nodwarf5
Git commit: 1.fc43
Built: Wed Mar 25 00:00:00 2026
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 29.3.1
API version: 1.54 (minimum version 1.40)
Go version: go1.25.8 X:nodwarf5
Git commit: 1.fc43
Built: Wed Mar 25 00:00:00 2026
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 2.1.6
GitCommit: 1.fc43
runc:
Version: 1.4.1
GitCommit:
tini-static:
Version: 0.19.0
GitCommit:
docker info
Client:
Version: 29.3.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: 0.31.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 29.3.1
Storage Driver: overlayfs
driver-type: io.containerd.snapshotter.v1
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: /usr/bin/tini-static
containerd version: 1.fc43
runc version:
init version:
Security Options:
seccomp
Profile: builtin
selinux
cgroupns
Kernel Version: 6.19.10-200.fc43.x86_64
Operating System: Fedora Linux 43 (Workstation Edition)
OSType: linux
Architecture: x86_64
CPUs: 14
Total Memory: 30.76GiB
Name: sbrauner-thinkpadt14gen6.tpb.csb
ID: bfa28d86-9769-4985-99a5-75ec2afd61fd
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: false
Firewall Backend: iptables+firewalld
Additional Info
No response
- Ngôn ngữ chính
- Go
- Star
- 6.1k
- Fork
- 2.2k
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 28
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug status/0-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug status/0-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
docker/cli#7176 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
docker/cli#7005 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/feature status/0-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
docker/cli#6919 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
l3montree-dev/devguard#3146 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CLI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
databricks/cli#6910 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Table presenter appends a spurious ", ..." to the FIX column when all fix versions are already shownĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
canonical/microceph#900 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
vulncheck or vulndb
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày