[Bug]: Registry lookup always fails, so untagged images stay unknown

オープン 初心者向け
#11 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

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

調査の方向性

internal/source/registry.go の do() から始め、URL の構築と既存のページ送りの処理を確認します。internal/source/source_test.go のフェイクレジストリとアサーションを更新し、マニフェストの HEAD リクエストを含め、/v2/ のパスを要求するようにします。また、internal/source/resolve.go でキャッシュの動作を確認します。関連する Go テストを実行してください。タグなしの uptime-kuma:2 コンテナは実際のバージョンに解決され、存在しないタグが永続的にキャッシュされてはなりません。

索引モデルが issue の本文から書いたものです。

説明

bug good first issue
What happened?

The registry lookup never works, so any image on :latest, :2, :main or similar without a version label comes out as "Version unknown: registry lookup failed ... 404". The registry URLs are missing /v2/, so Docker Hub answers 404 and GHCR answers 303. With /v2/ added by hand, the same lookup for louislam/uptime-kuma:2 finds 2.5.12.

That lookup is what the README says makes :latest work, so it's a bit of a big one, but the fix is tiny.

Steps to reproduce
  1. Run the compose stack from the README
  2. Run louislam/uptime-kuma:2 next to it (it has no version label)
  3. Patchcall lists it as "Version unknown: registry lookup failed ... 404"
Version

1.0.0, and still there on main at 31c39ef

How are you running it?

Docker, with the README's compose file

Environment

Linux, Docker Engine

Relevant log output
Version unknown: registry lookup failed ... 404
Before submitting
  • I have searched existing issues for duplicates
  • I am running the latest version
  • I agree to follow this project's Code of Conduct
Fix

do() in internal/source/registry.go:104-108 builds https://<registry>/<path><suffix>. Make it https://<api>/v2/<path><suffix>. The next-page handling at registry.go:98 already strips /v2/<path>, so that bit stays as it is.

The test in internal/source/source_test.go:95 only checks the path ends in /tags/list, which is how this got past it. Make the fake registry refuse anything that isn't under /v2/, for the manifest HEADs too.

While you're in there: an empty result gets cached for good (internal/source/resolve.go:122), so a :latest pulled before its version tag lands stays unknown until the next pull. Only cache a tag it actually found.

To check it, an uptime-kuma:2 container with no version label should show its real version (2.5.12 at the time of writing).

主要言語
Go
スター
3
フォーク
1
平均マージ
1時間 11分
マージ済み PR(30日)
10

環境構築

はじめの一歩

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

NotAFlightRisk/patchcall のほかの issue

NotAFlightRisk/patchcall の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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