Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pål Karlsrud
helm
Commits
8befd50c
Commit
8befd50c
authored
Aug 29, 2017
by
Justin Scott
Committed by
GitHub
Aug 29, 2017
Browse files
Merge pull request #2850 from rocky-nupt/fix-update-delete-subcharts
Fix(helm): Fix the bug of dependency update deleting subcharts
parents
1dbbace8
b79033a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
pkg/downloader/manager.go
View file @
8befd50c
...
...
@@ -264,6 +264,9 @@ func (m *Manager) downloadAll(deps []*chartutil.Dependency) error {
return
err
}
}
if
err
:=
move
(
tmpPath
,
destPath
);
err
!=
nil
{
return
err
}
if
err
:=
os
.
RemoveAll
(
tmpPath
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Failed to remove %v: %v"
,
tmpPath
,
err
)
}
...
...
@@ -610,3 +613,17 @@ func tarFromLocalDir(chartpath string, name string, repo string, version string)
return
""
,
fmt
.
Errorf
(
"can't get a valid version for dependency %s"
,
name
)
}
// move files from tmppath to destpath
func
move
(
tmpPath
,
destPath
string
)
error
{
files
,
_
:=
ioutil
.
ReadDir
(
tmpPath
)
for
_
,
file
:=
range
files
{
filename
:=
file
.
Name
()
tmpfile
:=
filepath
.
Join
(
tmpPath
,
filename
)
destfile
:=
filepath
.
Join
(
destPath
,
filename
)
if
err
:=
os
.
Rename
(
tmpfile
,
destfile
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Unable to move local charts to charts dir: %v"
,
err
)
}
}
return
nil
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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