fix(volume/prune): document label!= filter in --filter flag description#6924
fix(volume/prune): document label!= filter in --filter flag description#6924mohithshuka wants to merge 2 commits intodocker:masterfrom
Conversation
Fixes #24643 --kernel-memory was deprecated in v20.10 and removed in v23.0. Add deprecation callouts to both the options table and the Kernel memory constraints section of the run reference page.
The --filter flag for 'docker volume prune' previously only showed 'label=<label>' as an example, not mentioning the negation form 'label!=<label>', even though it is valid and supported by the daemon. Fixes docker#6918 Signed-off-by: mohithshuka <153504854+mohithshuka@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates CLI/documentation text to better reflect supported flag/filter behavior in the Docker CLI docs and help output.
Changes:
- Extend
docker volume prune --filterflag description to includelabel!=...as a valid example. - Mark
docker run --kernel-memoryas deprecated/removed and add a deprecation notice in the “Kernel memory constraints” section.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
cli/command/volume/prune.go |
Updates --filter flag help text to mention both label= and label!= forms. |
docs/reference/run.md |
Changes --kernel-memory option description and adds a deprecation callout in the kernel memory section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| flags.SetAnnotation("all", "version", []string{"1.42"}) | ||
| flags.BoolVarP(&options.force, "force", "f", false, "Do not prompt for confirmation") | ||
| flags.Var(&options.filter, "filter", `Provide filter values (e.g. "label=<label>")`) | ||
| flags.Var(&options.filter, "filter", `Provide filter values (e.g. "label=<label>" or "label!=<label>")`) | ||
|
|
There was a problem hiding this comment.
This PR updates the --filter help text, but the generated CLI reference docs still show only label=<label> for docker volume prune --filter (see docs/reference/commandline/volume_prune.md marker block). Please regenerate/update the command reference so the documentation published from this repo reflects the new label!=... example as well.
| | `--memory-swap=""` | Total memory limit (memory + swap, format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | | ||
| | `--memory-reservation=""` | Memory soft limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | | ||
| | `--kernel-memory=""` | Kernel memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. Minimum is 4M. | | ||
| | `--kernel-memory=""` | **Deprecated**: Kernel memory limit. Deprecated in Docker v20.10, and removed in Docker v23.0. This option is ignored when set. | | ||
| | `-c`, `--cpu-shares=0` | CPU shares (relative weight) | |
There was a problem hiding this comment.
The deprecation sentence has a grammatical issue: remove the comma after Docker v20.10 ("Deprecated in Docker v20.10 and removed in Docker v23.0").
| > **Deprecated** | ||
| > | ||
| > The `--kernel-memory` option was deprecated in Docker v20.10 and removed in | ||
| > Docker v23.0. The Linux kernel deprecated `kmem.limit_in_bytes` in kernel | ||
| > v5.4, and OCI runtimes such as runc no longer support this option. Docker API | ||
| > v1.42 and later ignores this option when set. Do not use `--kernel-memory` in | ||
| > new configurations. For more details, see the | ||
| > [Deprecated features](https://docs.docker.com/engine/deprecated/) page. |
There was a problem hiding this comment.
After adding this deprecation callout, the remainder of the “Kernel memory constraints” section still documents how to set and use --kernel-memory (including examples further down). That reads as contradictory to “removed/ignored” and can mislead readers; consider either removing the legacy instructions/examples, or explicitly scoping the rest of the section to older Engine versions where it applied.
| ### Kernel memory constraints | ||
|
|
||
| > **Deprecated** | ||
| > | ||
| > The `--kernel-memory` option was deprecated in Docker v20.10 and removed in |
There was a problem hiding this comment.
PR description/title indicate the change is only about docker volume prune --filter documentation, but this PR also changes docker run documentation for --kernel-memory. If this is intentional, please update the PR description (or split into a separate PR) so reviewers and release notes correctly reflect the additional documentation change.
Fixes #6918
What changed
The
--filterflag fordocker volume pruneonly showedlabel=<label>as an example, leaving users unaware that
label!=<label>is also valid.This updates the flag description to mention both forms.
How to verify
Run: