image prune: --filter until= with an empty value is ignored and prunes every unused image
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
Start with pkg/imgutil/filtering.go and the reported ParseFilters check, then read TestFilterUntil and the parsing tests. The issue reports an open linked pull request (#5304), so work is already underway. Done means ParseFilters([]string{"until="}) returns the expected “no until timestamp provided” error.
索引モデルが issue の本文から書いたものです。
説明
Description
imgutil.ParseFilters accepts until= with an empty value, and nerdctl image prune then ignores the filter and prunes every image it would prune without a filter.
In pkg/imgutil/filtering.go the check for an empty timestamp looks at the filter name instead of the value, so it can never fail:
} else if tempFilterToken[0] == FilterUntilType {
if len(tempFilterToken[0]) == 0 { // tempFilterToken[0] is "until"
return nil, errNoUntilTimestamp
f.Until stays empty, and pkg/cmd/image/prune.go only adds the until filter when len(parsedFilters.Until) > 0. So nerdctl image prune -a --filter until= removes all unused images (and without -a all dangling images) instead of returning no until timestamp provided, which is what FilterUntil("") and the existing TestFilterUntil expect. It also matters in scripts that build the value, for example --filter until=$(some-command) where the command prints nothing, together with --force.
I found this by reading the code and checked it with a unit test on ParseFilters, not by running nerdctl image prune against containerd.
Steps to reproduce the issue
_, err := imgutil.ParseFilters([]string{"until="})
// err is nil, errNoUntilTimestamp is expected
Or nerdctl image prune -a --force --filter until= on a host with unused images.
Describe the results you received and expected
Received: no error, and the unused images are removed as if no filter was given.
Expected: no until timestamp provided, and nothing is removed.
What version of nerdctl are you using?
main (5140812f)
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
No
Host information
macOS, go1.26.8 (the unit test does not need containerd)
- 主要言語
- Go
- スター
- 10.5k
- フォーク
- 839
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 38
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
containerd/nerdctl のほかの issue
-
Test and examples: update wordpress images (to silence potential false security alerts)再び着手できるかも @ayushpratap27 が 7 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンarea/ci documentation priority/low
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
containerd/nerdctl#5283 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
`nerdctl kill` shouldn't set `containerd.io/restart.explicitly-stopped` label for non-stop signals対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
containerd/nerdctl#5171 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
v2.4.2 planningオープンarea/project
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
containerd/nerdctl#5294 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
CI: migrate `ecr.aws` images to GHCR (to avoid the ECR rate limit)対応中かも @mainguyen0112 が 2 日前に担当しました。 オープンarea/ci priority/high
containerd/nerdctl#5293 · コメント 6 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
nerdctl rm -f exits 0 when task deletion fails, so callers cannot detect a failed removal対応中かも @sarankumar1325 が 5 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
containerd/nerdctl#5288 ·
メンテナーはふだん 2 日以内に返信
containerd/nerdctl の issue をすべて見る
似ている issue
-
Object Manager 1.13 resets a vCLU after sending a project対応中かも @tciunelis が今日担当しました。 オープンbug ready ticket
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Domktorymysli/vclu#152 ·
メンテナーはふだん 1 日以内に返信
-
bug converter
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
grafana/sigma-rule-deployment#435 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
🤖 verification skills: harden check.sh and verify.sh argument and file handling (#391 follow-ups)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/go-containerregistry#2491 ·
メンテナーはふだん 1 日以内に返信