Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

image prune: --filter until= with an empty value is ignored and prunes every unused image

オープン
#5,303 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ogulcanaydogan がすでに取り組んでいます。

2026年10月28日 から。

  • #5304 @ogulcanaydogan による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
go
領域
cli, testing

調査の方向性

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 ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

containerd/nerdctl のほかの issue

containerd/nerdctl の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。