Skip to content

Fix registryPattern to support registry names with port numbers#2550

Open
alexchenai wants to merge 1 commit intobuildpacks:mainfrom
alexchenai:fix/registry-pattern-port-support
Open

Fix registryPattern to support registry names with port numbers#2550
alexchenai wants to merge 1 commit intobuildpacks:mainfrom
alexchenai:fix/registry-pattern-port-support

Conversation

@alexchenai
Copy link

Summary

  • Fixes canBeRegistryRef returning false for valid registry references that include port numbers (e.g., localhost:5000/namespace/name)
  • Adds optional port number group (?:[0-9]+)? to the registryPattern regex
  • Adds test cases for registry locators with port numbers

Fixes #2536

Test plan

  • Existing tests pass without modification
  • New test cases verify localhost:5000/foo and myregistry:8080/bar are recognized as RegistryLocator
  • Registry references without ports continue to work as before

The registryPattern regex did not account for port numbers in registry
references (e.g., localhost:5000/namespace/name), causing canBeRegistryRef
to return false for valid registry URIs that include ports.

Add an optional port number group (?:[0-9]+)? to the regex pattern.

Fixes buildpacks#2536
@alexchenai alexchenai requested review from a team as code owners March 19, 2026 11:36
@github-actions github-actions bot added this to the 0.41.0 milestone Mar 19, 2026
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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 falso on registry names with port numbers

1 participant