Panic while parsing Git repository URL from Bitbucket #4011
Labels
area/api
issues for api module
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Describe the bug
When specifying a Bitbucket repository HTTPS URL as a resource, there is a panic in api/internal/git/repospec.go:128
kustomize/api/internal/git/repospec.go
Line 128 in 0f614e9
n is empty while parsing the URL below, therefore it panics when accessing
n[0]
. This happens in general, when the repository URL ends in .git.Files that can reproduce the issue
kustomization.yaml
Expected output
Resources from that repository, or an error message related to the repository not existing.
Actual output
Kustomize version
{Version:kustomize/v4.1.3 GitCommit:0f614e92f72f1b938a9171b964d90b197ca8fb68 BuildDate:2021-05-20T20:52:40Z GoOs:darwin GoArch:amd64}
Platform
MacOS 10.15.7
Additional context
Working around this bug is possible, by leaving out the
.git
at the end, or if not possible, specifying?ref=master
. That should not change the behavior, but it gives the parser something to parse, so then[0]
access is possible.The text was updated successfully, but these errors were encountered: