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

Đang mở Phù hợp với người mới
#11 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
90/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, go
Lĩnh vực
devops

Hướng nghiên cứu

Bắt đầu với do() trong internal/source/registry.go và kiểm tra việc xây dựng URL cùng cách xử lý trang tiếp theo hiện có. Cập nhật fake registry và các assertion trong internal/source/source_test.go để yêu cầu các đường dẫn /v2/, bao gồm cả các yêu cầu HEAD đối với manifest, và kiểm tra hành vi cache trong internal/source/resolve.go. Chạy các bài kiểm thử Go liên quan; một container uptime-kuma:2 không có tag phải được phân giải thành một phiên bản thực, và các tag không tồn tại không được lưu vào cache vĩnh viễn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
3
Fork
1
Merge trung bình
1 giờ 11 phút
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NotAFlightRisk/patchcall

Tất cả issue của NotAFlightRisk/patchcall

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.