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
5a217423
Commit
5a217423
authored
Jun 07, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(helm): fix repo package to use chartutil
parent
377a4338
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
index.go
pkg/repo/index.go
+2
-2
index_test.go
pkg/repo/index_test.go
+6
-3
repo.go
pkg/repo/repo.go
+4
-4
frobnitz-1.2.3.tgz
pkg/repo/testdata/repository/frobnitz-1.2.3.tgz
+0
-0
sprocket-1.2.0.tgz
pkg/repo/testdata/repository/sprocket-1.2.0.tgz
+0
-0
No files found.
pkg/repo/index.go
View file @
5a217423
...
...
@@ -7,7 +7,7 @@ import (
"gopkg.in/yaml.v2"
"k8s.io/helm/pkg/chart"
"k8s.io/helm/pkg/
proto/hapi/
chart"
)
var
indexPath
=
"index.yaml"
...
...
@@ -24,7 +24,7 @@ type ChartRef struct {
Created
string
`yaml:"created,omitempty"`
Removed
bool
`yaml:"removed,omitempty"`
Checksum
string
`yaml:"checksum,omitempty"`
Chartfile
chart
.
Chartfile
`yaml:"chartfile"`
Chartfile
*
chart
.
Metadata
`yaml:"chartfile"`
}
// DownloadIndexFile uses
...
...
pkg/repo/index_test.go
View file @
5a217423
...
...
@@ -29,7 +29,12 @@ func TestDownloadIndexFile(t *testing.T) {
fmt
.
Fprintln
(
w
,
string
(
fileBytes
))
}))
dirName
,
err
:=
ioutil
.
TempDir
(
"testdata"
,
"tmp"
)
dirName
,
err
:=
ioutil
.
TempDir
(
""
,
"tmp"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
defer
os
.
RemoveAll
(
dirName
)
path
:=
filepath
.
Join
(
dirName
,
testRepo
+
"-index.yaml"
)
if
err
:=
DownloadIndexFile
(
testRepo
,
ts
.
URL
,
path
);
err
!=
nil
{
t
.
Errorf
(
"%#v"
,
err
)
...
...
@@ -54,8 +59,6 @@ func TestDownloadIndexFile(t *testing.T) {
t
.
Errorf
(
"Expected 2 entries in index file but got %v"
,
numEntries
)
}
os
.
Remove
(
path
)
os
.
Remove
(
dirName
)
}
func
TestLoadIndexFile
(
t
*
testing
.
T
)
{
...
...
pkg/repo/repo.go
View file @
5a217423
...
...
@@ -13,7 +13,7 @@ import (
"gopkg.in/yaml.v2"
"k8s.io/helm/pkg/chart"
"k8s.io/helm/pkg/chart
util
"
)
// ChartRepository represents a chart repository
...
...
@@ -108,12 +108,12 @@ func (r *ChartRepository) Index() error {
}
for
_
,
path
:=
range
r
.
ChartPaths
{
ch
,
err
:=
chart
.
Load
(
path
)
ch
,
err
:=
chart
util
.
Load
(
path
)
if
err
!=
nil
{
return
err
}
chartfile
:=
ch
.
Chartfile
()
chartfile
:=
ch
.
Metadata
hash
,
err
:=
generateChecksum
(
path
)
if
err
!=
nil
{
return
err
...
...
@@ -135,7 +135,7 @@ func (r *ChartRepository) Index() error {
url
,
_
:=
url
.
Parse
(
r
.
URL
)
url
.
Path
=
filepath
.
Join
(
url
.
Path
,
key
+
".tgz"
)
entry
:=
&
ChartRef
{
Chartfile
:
*
chartfile
,
Name
:
chartfile
.
Name
,
URL
:
url
.
String
(),
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/testdata/repository/frobnitz-1.2.3.tgz
View file @
5a217423
No preview for this file type
pkg/repo/testdata/repository/sprocket-1.2.0.tgz
View file @
5a217423
No preview for this file type
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