Merge a5fdfad6ff6b91bb4dcb8134638f6e0f4208289b into d7eb05b9361febead29a74e71ddffc2ebeff5302
This commit is contained in:
commit
56b5571fbc
@ -50,7 +50,7 @@ func ParseModelPath(name string) ModelPath {
|
||||
}
|
||||
|
||||
name = strings.ReplaceAll(name, string(os.PathSeparator), "/")
|
||||
parts := strings.Split(name, "/")
|
||||
parts := strings.SplitN(name, "/", 3)
|
||||
switch len(parts) {
|
||||
case 3:
|
||||
mp.Registry = parts[0]
|
||||
|
@ -143,6 +143,17 @@ func TestParseModelPath(t *testing.T) {
|
||||
Tag: DefaultTag,
|
||||
},
|
||||
},
|
||||
{
|
||||
"path with more than three parts",
|
||||
"https://example.com/ns/another-part/repo:tag",
|
||||
ModelPath{
|
||||
ProtocolScheme: "https",
|
||||
Registry: "example.com",
|
||||
Namespace: "ns",
|
||||
Repository: "another-part/repo",
|
||||
Tag: "tag",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
|
Loading…
x
Reference in New Issue
Block a user