|
|
@ -162,6 +162,13 @@ func (m *Manager) Update() error {
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check if there is already subchart in charts directory before downloading tarball.
|
|
|
|
|
|
|
|
// https://github.com/helm/helm/issues/30710
|
|
|
|
|
|
|
|
err = m.checkSubchartConflict(req)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return fmt.Errorf("%s. Please remove the manually added subchart or exclude it from Chart.yaml dependencies", err.Error())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get the names of the repositories the dependencies need that Helm is
|
|
|
|
// Get the names of the repositories the dependencies need that Helm is
|
|
|
|
// configured to know about.
|
|
|
|
// configured to know about.
|
|
|
|
repoNames, err := m.resolveRepoNames(req)
|
|
|
|
repoNames, err := m.resolveRepoNames(req)
|
|
|
@ -298,12 +305,6 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check if subchart already exist before downloading tarball.
|
|
|
|
|
|
|
|
// https://github.com/helm/helm/issues/30710
|
|
|
|
|
|
|
|
if _, err := os.Stat(chartPath); !os.IsNotExist(err) {
|
|
|
|
|
|
|
|
return fmt.Errorf("dependency conflict detected: A subchart named '%s' already exists in charts/ directory", dep.Name)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if strings.HasPrefix(dep.Repository, "file://") {
|
|
|
|
if strings.HasPrefix(dep.Repository, "file://") {
|
|
|
|
if m.Debug {
|
|
|
|
if m.Debug {
|
|
|
|
fmt.Fprintf(m.Out, "Archiving %s from repo %s\n", dep.Name, dep.Repository)
|
|
|
|
fmt.Fprintf(m.Out, "Archiving %s from repo %s\n", dep.Name, dep.Repository)
|
|
|
@ -847,6 +848,22 @@ func (m *Manager) loadChartRepositories() (map[string]*repo.ChartRepository, err
|
|
|
|
return indices, nil
|
|
|
|
return indices, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// checkSubchartConflict Check if subchart already exist before downloading tarball.
|
|
|
|
|
|
|
|
func (m *Manager) checkSubchartConflict(req []*chart.Dependency) error {
|
|
|
|
|
|
|
|
for _, dep := range req {
|
|
|
|
|
|
|
|
// No repository means the chart is in charts directory
|
|
|
|
|
|
|
|
if dep.Repository == "" {
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
chartPath := filepath.Join(m.ChartPath, "charts", dep.Name)
|
|
|
|
|
|
|
|
if _, err := os.Stat(chartPath); !os.IsNotExist(err) {
|
|
|
|
|
|
|
|
return fmt.Errorf("dependency conflict detected: A subchart named '%s' already exists in charts/ directory", dep.Name)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// writeLock writes a lockfile to disk
|
|
|
|
// writeLock writes a lockfile to disk
|
|
|
|
func writeLock(chartpath string, lock *chart.Lock, legacyLockfile bool) error {
|
|
|
|
func writeLock(chartpath string, lock *chart.Lock, legacyLockfile bool) error {
|
|
|
|
data, err := yaml.Marshal(lock)
|
|
|
|
data, err := yaml.Marshal(lock)
|
|
|
|