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
e3f39f30
Commit
e3f39f30
authored
Jan 09, 2017
by
Anton Galitsyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename URLAreEqual func
parent
a82c19b9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
manager.go
cmd/helm/downloader/manager.go
+3
-3
urlutil.go
pkg/urlutil/urlutil.go
+2
-4
urlutil_test.go
pkg/urlutil/urlutil_test.go
+2
-2
No files found.
cmd/helm/downloader/manager.go
View file @
e3f39f30
...
@@ -227,7 +227,7 @@ func (m *Manager) hasAllRepos(deps []*chartutil.Dependency) error {
...
@@ -227,7 +227,7 @@ func (m *Manager) hasAllRepos(deps []*chartutil.Dependency) error {
found
=
true
found
=
true
}
else
{
}
else
{
for
_
,
repo
:=
range
repos
{
for
_
,
repo
:=
range
repos
{
if
urlutil
.
URLAre
Equal
(
repo
.
URL
,
strings
.
TrimSuffix
(
dd
.
Repository
,
"/"
))
{
if
urlutil
.
Equal
(
repo
.
URL
,
strings
.
TrimSuffix
(
dd
.
Repository
,
"/"
))
{
found
=
true
found
=
true
}
}
}
}
...
@@ -259,7 +259,7 @@ func (m *Manager) getRepoNames(deps []*chartutil.Dependency) (map[string]string,
...
@@ -259,7 +259,7 @@ func (m *Manager) getRepoNames(deps []*chartutil.Dependency) (map[string]string,
found
:=
false
found
:=
false
for
_
,
repo
:=
range
repos
{
for
_
,
repo
:=
range
repos
{
if
urlutil
.
URLAre
Equal
(
repo
.
URL
,
dd
.
Repository
)
{
if
urlutil
.
Equal
(
repo
.
URL
,
dd
.
Repository
)
{
found
=
true
found
=
true
reposMap
[
dd
.
Name
]
=
repo
.
Name
reposMap
[
dd
.
Name
]
=
repo
.
Name
break
break
...
@@ -325,7 +325,7 @@ func (m *Manager) parallelRepoUpdate(repos []*repo.ChartRepositoryConfig) error
...
@@ -325,7 +325,7 @@ func (m *Manager) parallelRepoUpdate(repos []*repo.ChartRepositoryConfig) error
// If it finds a URL that is "relative", it will prepend the repoURL.
// If it finds a URL that is "relative", it will prepend the repoURL.
func
findChartURL
(
name
,
version
,
repoURL
string
,
repos
map
[
string
]
*
repo
.
ChartRepository
)
(
string
,
error
)
{
func
findChartURL
(
name
,
version
,
repoURL
string
,
repos
map
[
string
]
*
repo
.
ChartRepository
)
(
string
,
error
)
{
for
_
,
cr
:=
range
repos
{
for
_
,
cr
:=
range
repos
{
if
urlutil
.
URLAre
Equal
(
repoURL
,
cr
.
Config
.
URL
)
{
if
urlutil
.
Equal
(
repoURL
,
cr
.
Config
.
URL
)
{
entry
,
err
:=
findEntryByName
(
name
,
cr
)
entry
,
err
:=
findEntryByName
(
name
,
cr
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
pkg/urlutil/urlutil.go
View file @
e3f39f30
...
@@ -41,10 +41,8 @@ func URLJoin(baseURL string, paths ...string) (string, error) {
...
@@ -41,10 +41,8 @@ func URLJoin(baseURL string, paths ...string) (string, error) {
return
u
.
String
(),
nil
return
u
.
String
(),
nil
}
}
// URLAreEqual normalizes two URLs and then compares for equality.
// Equal normalizes two URLs and then compares for equality.
//
func
Equal
(
a
,
b
string
)
bool
{
// TODO: This and the urlJoin functions should really be moved to a 'urlutil' package.
func
URLAreEqual
(
a
,
b
string
)
bool
{
au
,
err
:=
url
.
Parse
(
a
)
au
,
err
:=
url
.
Parse
(
a
)
if
err
!=
nil
{
if
err
!=
nil
{
a
=
filepath
.
Clean
(
a
)
a
=
filepath
.
Clean
(
a
)
...
...
pkg/urlutil/urlutil_test.go
View file @
e3f39f30
...
@@ -39,7 +39,7 @@ func TestUrlJoin(t *testing.T) {
...
@@ -39,7 +39,7 @@ func TestUrlJoin(t *testing.T) {
}
}
}
}
func
Test
UrlAre
Equal
(
t
*
testing
.
T
)
{
func
TestEqual
(
t
*
testing
.
T
)
{
for
_
,
tt
:=
range
[]
struct
{
for
_
,
tt
:=
range
[]
struct
{
a
,
b
string
a
,
b
string
match
bool
match
bool
...
@@ -57,7 +57,7 @@ func TestUrlAreEqual(t *testing.T) {
...
@@ -57,7 +57,7 @@ func TestUrlAreEqual(t *testing.T) {
{
"/foo"
,
"/foo/"
,
true
},
{
"/foo"
,
"/foo/"
,
true
},
{
"/foo/."
,
"/foo/"
,
true
},
{
"/foo/."
,
"/foo/"
,
true
},
}
{
}
{
if
tt
.
match
!=
URLAre
Equal
(
tt
.
a
,
tt
.
b
)
{
if
tt
.
match
!=
Equal
(
tt
.
a
,
tt
.
b
)
{
t
.
Errorf
(
"Expected %q==%q to be %t"
,
tt
.
a
,
tt
.
b
,
tt
.
match
)
t
.
Errorf
(
"Expected %q==%q to be %t"
,
tt
.
a
,
tt
.
b
,
tt
.
match
)
}
}
}
}
...
...
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