Skip to content

name: treat localhost as an explicit registry#2322

Open
Haihan-Jiang wants to merge 1 commit into
google:mainfrom
Haihan-Jiang:codex/localhost-registry-name
Open

name: treat localhost as an explicit registry#2322
Haihan-Jiang wants to merge 1 commit into
google:mainfrom
Haihan-Jiang:codex/localhost-registry-name

Conversation

@Haihan-Jiang

Copy link
Copy Markdown
Contributor

Summary

Fixes #2048.

Docker-style image reference parsing treats the first path component as a registry when it contains . or :, and also when it is exactly localhost. NewRepository only handled the . / : cases, so localhost/testimage:mytag was parsed as a Docker Hub repository path instead of using localhost as the registry. That caused daemon lookups for Podman-tagged images such as localhost/testimage:mytag to resolve as index.docker.io/localhost/testimage:mytag / docker.io/library/testimage:mytag instead of the local daemon tag.

This change recognizes localhost as an explicit registry component and also makes the bare localhost registry use the same http scheme fallback as localhost:<port>.

Test plan

  • go test ./pkg/name
  • go test ./pkg/name ./pkg/v1/daemon ./pkg/v1/remote
  • go test ./...
  • git diff --check

@Haihan-Jiang

Copy link
Copy Markdown
Contributor Author

This is ready for review. The name parser now treats localhost as an explicit registry, with updated registry/repository/tag coverage. The visible checks are green.

@Haihan-Jiang
Haihan-Jiang force-pushed the codex/localhost-registry-name branch from a77335c to 58da07e Compare June 14, 2026 11:15
@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.03%. Comparing base (02649ea) to head (58da07e).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2322   +/-   ##
=======================================
  Coverage   57.03%   57.03%           
=======================================
  Files         166      166           
  Lines       11442    11442           
=======================================
  Hits         6526     6526           
  Misses       4140     4140           
  Partials      776      776           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ggcr: registry on localhost is defaulted to docker.io - image not known when accessing image

2 participants