Skip to content

Fix docker URIs with registry ports - #2689

Open
devinhuang2001 wants to merge 4 commits into
buildpacks:mainfrom
devinhuang2001:fix/docker-uri-registry-port
Open

devinhuang2001 wants to merge 4 commits into
buildpacks:mainfrom
devinhuang2001:fix/docker-uri-registry-port

Conversation

@devinhuang2001

Copy link
Copy Markdown

Summary

  • normalize the docker URI scheme before parsing the image reference
  • cover docker URIs whose registry includes a port

Fixes #2536

Testing

  • go test ./pkg/buildpack -run TestGetLocatorType -count=1 (blocked locally because the network cannot download Go modules from proxy.golang.org; setup failed before test execution)
  • gofmt -d pkg/buildpack/locator_type.go pkg/buildpack/locator_type_test.go
  • git diff --check

@devinhuang2001
devinhuang2001 requested review from a team as code owners September 8, 2026 12:15
@devinhuang2001
devinhuang2001 force-pushed the fix/docker-uri-registry-port branch from 3f2920b to 4ebf5bb Compare September 8, 2026 12:18
Signed-off-by: devin huang <akahuang666@gmail.com>
@devinhuang2001
devinhuang2001 force-pushed the fix/docker-uri-registry-port branch from 4ebf5bb to ce0c6c5 Compare September 8, 2026 12:19
@github-actions github-actions Bot added this to the 0.41.0 milestone Sep 8, 2026
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label Sep 8, 2026
@devinhuang2001

Copy link
Copy Markdown
Author

The PR body notes that the tests could not be run when this was opened because Go modules could not be downloaded. I ran them on the current head ed5e1a3 with a working proxy:

$ go test ./pkg/buildpack -run TestGetLocatorType -count=1
ok  	github.com/buildpacks/pack/pkg/buildpack	0.497s

The new case (docker://localhost:5000/foo/bar → PackageLocator) passes, and so does the rest of the table, including the @sha256: and docker://registry.com/cnbs/some-bp cases that sit next to it.

CI is green here too (14 checks passing, 2 skipped) and the branch is current with main, so as far as I can tell this is only waiting on a review. Is there anything else you would want covered — for example a port in a URI without a registry path, or a malformed port?

@jjbustamante jjbustamante added type/bug Issue that reports an unexpected behaviour. and removed type/enhancement Issue that requests a new feature or improvement. labels Nov 15, 2026
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label Nov 25, 2026

This branch has not been deployed

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

Labels

type/bug Issue that reports an unexpected behaviour. type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

canBeRegistryRef returns false on registry names with port numbers

2 participants