Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
8867e744
Commit
8867e744
authored
May 01, 2024
by
Michael Yang
Browse files
types/model: fix name for hostport
parent
a3e60d90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
types/model/name.go
types/model/name.go
+5
-1
types/model/name_test.go
types/model/name_test.go
+8
-0
No files found.
types/model/name.go
View file @
8867e744
...
...
@@ -143,7 +143,11 @@ func ParseNameBare(s string) Name {
n
.
RawDigest
=
MissingPart
}
s
,
n
.
Tag
,
_
=
cutPromised
(
s
,
":"
)
// "/" is an illegal tag character, so we can use it to split the host
if
strings
.
LastIndex
(
s
,
":"
)
>
strings
.
LastIndex
(
s
,
"/"
)
{
s
,
n
.
Tag
,
_
=
cutPromised
(
s
,
":"
)
}
s
,
n
.
Model
,
promised
=
cutPromised
(
s
,
"/"
)
if
!
promised
{
n
.
Model
=
s
...
...
types/model/name_test.go
View file @
8867e744
...
...
@@ -34,6 +34,14 @@ func TestParseNameParts(t *testing.T) {
Model
:
"model"
,
},
},
{
in
:
"host:12345/namespace/model"
,
want
:
Name
{
Host
:
"host:12345"
,
Namespace
:
"namespace"
,
Model
:
"model"
,
},
},
{
in
:
"namespace/model"
,
want
:
Name
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment