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
8358f4d3
Commit
8358f4d3
authored
May 21, 2016
by
Michelle Noorali
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #754 from michelleN/index-url
ref(helm): fix chart url in index file
parents
48a4265d
b4844383
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
index.go
pkg/repo/index.go
+1
-1
repo.go
pkg/repo/repo.go
+5
-3
repo_test.go
pkg/repo/repo_test.go
+6
-2
No files found.
pkg/repo/index.go
View file @
8358f4d3
...
...
@@ -23,7 +23,7 @@ type ChartRef struct {
URL
string
`yaml:"url"`
Created
string
`yaml:"created,omitempty"`
Removed
bool
`yaml:"removed,omitempty"`
Digest
string
`yaml:"digest
,omitempty"`
Checksum
string
`yaml:"checksum
,omitempty"`
Chartfile
chart
.
Chartfile
`yaml:"chartfile"`
}
...
...
pkg/repo/repo.go
View file @
8358f4d3
...
...
@@ -117,7 +117,7 @@ func (r *ChartRepository) Index() error {
}
chartfile
:=
ch
.
Chartfile
()
hash
,
err
:=
generate
Digest
(
path
)
hash
,
err
:=
generate
Checksum
(
path
)
if
err
!=
nil
{
return
err
}
...
...
@@ -135,7 +135,9 @@ func (r *ChartRepository) Index() error {
created
=
time
.
Now
()
.
UTC
()
.
String
()
}
entry
:=
&
ChartRef
{
Chartfile
:
*
chartfile
,
Name
:
chartfile
.
Name
,
URL
:
r
.
URL
,
Created
:
created
,
Digest
:
hash
,
Removed
:
false
}
url
:=
filepath
.
Join
(
r
.
URL
,
key
+
".tgz"
)
entry
:=
&
ChartRef
{
Chartfile
:
*
chartfile
,
Name
:
chartfile
.
Name
,
URL
:
url
,
Created
:
created
,
Checksum
:
hash
,
Removed
:
false
}
r
.
IndexFile
.
Entries
[
key
]
=
entry
...
...
@@ -148,7 +150,7 @@ func (r *ChartRepository) Index() error {
return
nil
}
func
generate
Digest
(
path
string
)
(
string
,
error
)
{
func
generate
Checksum
(
path
string
)
(
string
,
error
)
{
f
,
err
:=
os
.
Open
(
path
)
if
err
!=
nil
{
return
""
,
err
...
...
pkg/repo/repo_test.go
View file @
8358f4d3
...
...
@@ -69,8 +69,8 @@ func TestIndex(t *testing.T) {
}
timestamps
[
chartName
]
=
details
.
Created
if
details
.
Digest
==
""
{
t
.
Errorf
(
"
Digest
was not set for %s"
,
chartName
)
if
details
.
Checksum
==
""
{
t
.
Errorf
(
"
Checksum
was not set for %s"
,
chartName
)
}
}
...
...
@@ -90,6 +90,10 @@ 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"
)
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