@@ -141,7 +141,7 @@ func (m *Manager) Build() error {
141
141
}
142
142
143
143
// Now we need to fetch every package here into charts/
144
- return m .downloadAll (lock .Dependencies , nil )
144
+ return m .downloadAll (lock .Dependencies )
145
145
}
146
146
147
147
// Update updates a local charts directory.
@@ -191,13 +191,13 @@ func (m *Manager) Update() error {
191
191
192
192
// Now we need to find out which version of a chart best satisfies the
193
193
// dependencies in the Chart.yaml
194
- lock , urls , err := m .resolve (req , repoNames )
194
+ lock , err := m .resolve (req , repoNames )
195
195
if err != nil {
196
196
return err
197
197
}
198
198
199
199
// Now we need to fetch every package here into charts/
200
- if err := m .downloadAll (lock .Dependencies , urls ); err != nil {
200
+ if err := m .downloadAll (lock .Dependencies ); err != nil {
201
201
return err
202
202
}
203
203
@@ -230,7 +230,7 @@ func (m *Manager) loadChartDir() (*chart.Chart, error) {
230
230
// resolve takes a list of dependencies and translates them into an exact version to download.
231
231
//
232
232
// This returns a lock file, which has all of the dependencies normalized to a specific version.
233
- func (m * Manager ) resolve (req []* chart.Dependency , repoNames map [string ]string ) (* chart.Lock , map [ string ] string , error ) {
233
+ func (m * Manager ) resolve (req []* chart.Dependency , repoNames map [string ]string ) (* chart.Lock , error ) {
234
234
res := resolver .New (m .ChartPath , m .RepositoryCache , m .RegistryClient )
235
235
return res .Resolve (req , repoNames )
236
236
}
@@ -239,7 +239,7 @@ func (m *Manager) resolve(req []*chart.Dependency, repoNames map[string]string)
239
239
//
240
240
// It will delete versions of the chart that exist on disk and might cause
241
241
// a conflict.
242
- func (m * Manager ) downloadAll (deps []* chart.Dependency , urls map [ string ] string ) error {
242
+ func (m * Manager ) downloadAll (deps []* chart.Dependency ) error {
243
243
repos , err := m .loadChartRepositories ()
244
244
if err != nil {
245
245
return err
@@ -312,7 +312,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency, urls map[string]string)
312
312
313
313
// Any failure to resolve/download a chart should fail:
314
314
// https://github.com/helm/helm/issues/1439
315
- churl , username , password , insecureskiptlsverify , passcredentialsall , caFile , certFile , keyFile , err := m .findChartURL (dep .Name , dep .Version , dep .Repository , repos , urls )
315
+ churl , username , password , insecureskiptlsverify , passcredentialsall , caFile , certFile , keyFile , err := m .findChartURL (dep .Name , dep .Version , dep .Repository , repos )
316
316
if err != nil {
317
317
saveError = errors .Wrapf (err , "could not find %s" , churl )
318
318
break
@@ -501,7 +501,6 @@ func (m *Manager) ensureMissingRepos(repoNames map[string]string, deps []*chart.
501
501
502
502
var ru []* repo.Entry
503
503
504
- Outer:
505
504
for _ , dd := range deps {
506
505
507
506
// If the chart is in the local charts directory no repository needs
@@ -529,14 +528,6 @@ Outer:
529
528
530
529
repoNames [dd .Name ] = rn
531
530
532
- // If repository is already present don't add to array. This will skip
533
- // unnecessary index file downloading improving performance.
534
- for _ , item := range ru {
535
- if item .URL == dd .Repository {
536
- continue Outer
537
- }
538
- }
539
-
540
531
// Assuming the repository is generally available. For Helm managed
541
532
// access controls the repository needs to be added through the user
542
533
// managed system. This path will work for public charts, like those
@@ -712,7 +703,7 @@ func (m *Manager) parallelRepoUpdate(repos []*repo.Entry) error {
712
703
// repoURL is the repository to search
713
704
//
714
705
// If it finds a URL that is "relative", it will prepend the repoURL.
715
- func (m * Manager ) findChartURL (name , version , repoURL string , repos map [string ]* repo.ChartRepository , urls map [ string ] string ) (url , username , password string , insecureskiptlsverify , passcredentialsall bool , caFile , certFile , keyFile string , err error ) {
706
+ func (m * Manager ) findChartURL (name , version , repoURL string , repos map [string ]* repo.ChartRepository ) (url , username , password string , insecureskiptlsverify , passcredentialsall bool , caFile , certFile , keyFile string , err error ) {
716
707
if registry .IsOCI (repoURL ) {
717
708
return fmt .Sprintf ("%s/%s:%s" , repoURL , name , version ), "" , "" , false , false , "" , "" , "" , nil
718
709
}
@@ -751,14 +742,7 @@ func (m *Manager) findChartURL(name, version, repoURL string, repos map[string]*
751
742
return
752
743
}
753
744
}
754
-
755
- urlsKey := repoURL + name + version
756
- if _ , ok := urls [urlsKey ]; ok {
757
- url = urls [urlsKey ]
758
- } else {
759
- url , err = repo .FindChartInRepoURL (repoURL , name , version , certFile , keyFile , caFile , m .Getters )
760
- }
761
-
745
+ url , err = repo .FindChartInRepoURL (repoURL , name , version , certFile , keyFile , caFile , m .Getters )
762
746
if err == nil {
763
747
return url , username , password , false , false , "" , "" , "" , err
764
748
}
0 commit comments