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
a0c1125a
Commit
a0c1125a
authored
Jun 02, 2016
by
Miguel Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(repo) Malformed URL
parent
96158386
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
repo.go
pkg/repo/repo.go
+4
-2
repo_test.go
pkg/repo/repo_test.go
+2
-1
No files found.
pkg/repo/repo.go
View file @
a0c1125a
...
...
@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io/ioutil"
"net/url"
"os"
"path/filepath"
"strings"
...
...
@@ -131,9 +132,10 @@ func (r *ChartRepository) Index() error {
created
=
time
.
Now
()
.
UTC
()
.
String
()
}
url
:=
filepath
.
Join
(
r
.
URL
,
key
+
".tgz"
)
url
,
_
:=
url
.
Parse
(
r
.
URL
)
url
.
Path
=
filepath
.
Join
(
url
.
Path
,
key
+
".tgz"
)
entry
:=
&
ChartRef
{
Chartfile
:
*
chartfile
,
Name
:
chartfile
.
Name
,
URL
:
url
,
Created
:
created
,
Checksum
:
hash
,
Removed
:
false
}
entry
:=
&
ChartRef
{
Chartfile
:
*
chartfile
,
Name
:
chartfile
.
Name
,
URL
:
url
.
String
()
,
Created
:
created
,
Checksum
:
hash
,
Removed
:
false
}
r
.
IndexFile
.
Entries
[
key
]
=
entry
...
...
pkg/repo/repo_test.go
View file @
a0c1125a
...
...
@@ -90,7 +90,8 @@ func TestIndex(t *testing.T) {
if
v
.
Created
!=
created
{
t
.
Errorf
(
"Expected Created timestamp to be %s, but got %s for chart %s"
,
created
,
v
.
Created
,
chart
)
}
expectedURL
:=
filepath
.
Join
(
cr
.
URL
,
chart
+
".tgz"
)
// Created manually since we control the input of the test
expectedURL
:=
testURL
+
"/"
+
chart
+
".tgz"
if
v
.
URL
!=
expectedURL
{
t
.
Errorf
(
"Expected url in entry to be %s but got %s for chart: %s"
,
expectedURL
,
v
.
URL
,
chart
)
}
...
...
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