Skip to content

Commit

Permalink
Merge pull request #969 from buildpacks/fix-968
Browse files Browse the repository at this point in the history
Improve locator type detection
  • Loading branch information
jromero authored Nov 30, 2020
2 parents f85ce47 + e9b854c commit 167bac5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/buildpack/locator_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func builderMatchFound(locator string, candidates []dist.BuildpackInfo) bool {
func hasHostPortPrefix(locator string) bool {
if strings.Contains(locator, "/") {
prefix := strings.Split(locator, "/")[0]
if strings.Contains(prefix, ":") {
if strings.Contains(prefix, ":") || strings.Contains(prefix, ".") {
return true
}
}
Expand Down
4 changes: 4 additions & 0 deletions internal/buildpack/locator_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ func testGetLocatorType(t *testing.T, when spec.G, it spec.S) {
locator: "localhost:1234/example/package-cnb",
expectedType: buildpack.PackageLocator,
},
{
locator: "dev.local/http-go-fn:latest",
expectedType: buildpack.PackageLocator,
},
} {
tc := tc

Expand Down

0 comments on commit 167bac5

Please sign in to comment.