Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
0b82b48c
Commit
0b82b48c
authored
Jan 07, 2016
by
vaikas-google
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up the code for fetching registries
parent
3db24d85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
typeresolver.go
manager/manager/typeresolver.go
+2
-2
inmem_repository_service.go
registry/inmem_repository_service.go
+1
-1
No files found.
manager/manager/typeresolver.go
View file @
0b82b48c
...
...
@@ -244,7 +244,7 @@ func (tr *typeResolver) ShortTypeToDownloadURLs(template string) ([]string, erro
if
len
(
m
)
!=
6
{
return
[]
string
{},
fmt
.
Errorf
(
"Failed to parse short github url: %s"
,
template
)
}
r
,
err
:=
tr
.
rp
.
GetRegistry
(
"github.com/"
+
m
[
1
]
+
"/"
+
m
[
2
]
)
r
,
err
:=
tr
.
rp
.
GetRegistry
(
template
)
if
err
!=
nil
{
return
[]
string
{},
err
}
...
...
@@ -262,7 +262,7 @@ func (tr *typeResolver) ShortTypeToPackageDownloadURLs(template string) ([]strin
if
len
(
m
)
!=
4
{
return
[]
string
{},
fmt
.
Errorf
(
"Failed to parse short github url: %s"
,
template
)
}
r
,
err
:=
tr
.
rp
.
GetRegistry
(
"github.com/"
+
m
[
1
]
+
"/"
+
m
[
2
]
)
r
,
err
:=
tr
.
rp
.
GetRegistry
(
template
)
if
err
!=
nil
{
return
[]
string
{},
err
}
...
...
registry/inmem_repository_service.go
View file @
0b82b48c
...
...
@@ -70,7 +70,7 @@ func (rs *inmemRepositoryService) Delete(name string) error {
// GetByURL returns a registry that handles the types for a given URL.
func
(
rs
*
inmemRepositoryService
)
GetByURL
(
URL
string
)
(
*
common
.
Registry
,
error
)
{
for
_
,
r
:=
range
rs
.
repositories
{
if
strings
.
HasPrefix
(
r
.
URL
,
URL
)
{
if
strings
.
HasPrefix
(
URL
,
r
.
URL
)
{
return
r
,
nil
}
}
...
...
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