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
0153d273
Commit
0153d273
authored
Feb 10, 2017
by
Qin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error checking from os.stat
parent
39a2d5ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
manager.go
pkg/downloader/manager.go
+10
-1
resolver.go
pkg/resolver/resolver.go
+2
-0
No files found.
pkg/downloader/manager.go
View file @
0153d273
...
...
@@ -320,6 +320,8 @@ func (m *Manager) getRepoNames(deps []*chartutil.Dependency) (map[string]string,
if
_
,
err
=
os
.
Stat
(
depPath
);
os
.
IsNotExist
(
err
)
{
return
nil
,
fmt
.
Errorf
(
"directory %s not found"
,
depPath
)
}
else
if
err
!=
nil
{
return
nil
,
err
}
fmt
.
Fprintf
(
m
.
Out
,
"Repository from local path: %s
\n
"
,
dd
.
Repository
)
...
...
@@ -516,13 +518,20 @@ func writeLock(chartpath string, lock *chartutil.RequirementsLock) error {
// archive a dep chart from local directory and save it into charts/
func
tarFromLocalDir
(
chartpath
string
,
name
string
,
repo
string
,
version
string
)
(
string
,
error
)
{
destPath
:=
filepath
.
Join
(
chartpath
,
"charts"
)
origPath
,
err
:=
filepath
.
Abs
(
repo
[
7
:
])
if
!
strings
.
HasPrefix
(
repo
,
"file://"
)
{
return
""
,
fmt
.
Errorf
(
"wrong format: chart %s repository %s"
,
name
,
repo
)
}
origPath
,
err
:=
filepath
.
Abs
(
strings
.
TrimPrefix
(
repo
,
"file://"
))
if
err
!=
nil
{
return
""
,
err
}
if
_
,
err
=
os
.
Stat
(
origPath
);
os
.
IsNotExist
(
err
)
{
return
""
,
fmt
.
Errorf
(
"directory %s not found: %s"
,
origPath
,
err
)
}
else
if
err
!=
nil
{
return
""
,
err
}
ch
,
err
:=
chartutil
.
LoadDir
(
origPath
)
...
...
pkg/resolver/resolver.go
View file @
0153d273
...
...
@@ -65,6 +65,8 @@ func (r *Resolver) Resolve(reqs *chartutil.Requirements, repoNames map[string]st
if
_
,
err
=
os
.
Stat
(
depPath
);
os
.
IsNotExist
(
err
)
{
return
nil
,
fmt
.
Errorf
(
"directory %s not found"
,
depPath
)
}
else
if
err
!=
nil
{
return
nil
,
err
}
locked
[
i
]
=
&
chartutil
.
Dependency
{
...
...
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