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

Aperta Adatta ai principianti
#11 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, go
Ambito
devops

Direzione di ricerca

Inizia con do() in internal/source/registry.go ed esamina la costruzione degli URL e la gestione esistente della pagina successiva. Aggiorna il fake registry e le asserzioni in internal/source/source_test.go per richiedere percorsi /v2/, incluse le richieste HEAD dei manifest, e verifica il comportamento della cache in internal/source/resolve.go. Esegui i test Go pertinenti; un container uptime-kuma:2 senza tag deve essere risolto in una versione reale, e i tag mancanti non devono essere mantenuti permanentemente in cache.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
Go
Stelle
3
Fork
1
Merge medio
1h 11m
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NotAFlightRisk/patchcall

Tutte le issue di NotAFlightRisk/patchcall

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.