mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
Merge pull request #13120 from idsulik/issue-13110
fix(dependencyBuild): prevent race condition in concurrent helm dependency
This commit is contained in:
commit
ff03c66d44
2 changed files with 4 additions and 3 deletions
|
|
@ -200,8 +200,9 @@ func TestDependencyUpdateCmd_DoNotDeleteOldChartsOnError(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// Make sure tmpcharts is deleted
|
||||
if _, err := os.Stat(filepath.Join(dir(chartname), "tmpcharts")); !os.IsNotExist(err) {
|
||||
// Make sure tmpcharts-x is deleted
|
||||
tmpPath := filepath.Join(dir(chartname), fmt.Sprintf("tmpcharts-%d", os.Getpid()))
|
||||
if _, err := os.Stat(tmpPath); !os.IsNotExist(err) {
|
||||
t.Fatalf("tmpcharts dir still exists")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
|
|||
}
|
||||
|
||||
destPath := filepath.Join(m.ChartPath, "charts")
|
||||
tmpPath := filepath.Join(m.ChartPath, "tmpcharts")
|
||||
tmpPath := filepath.Join(m.ChartPath, fmt.Sprintf("tmpcharts-%d", os.Getpid()))
|
||||
|
||||
// Check if 'charts' directory is not actually a directory. If it does not exist, create it.
|
||||
if fi, err := os.Stat(destPath); err == nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue