@ -141,7 +141,7 @@ func (m *Manager) Build() error {
}
}
// Now we need to fetch every package here into charts/
// Now we need to fetch every package here into charts/
return m . downloadAll ( lock . Dependencies , nil )
return m . downloadAll ( lock . Dependencies )
}
}
// Update updates a local charts directory.
// Update updates a local charts directory.
@ -191,13 +191,13 @@ func (m *Manager) Update() error {
// Now we need to find out which version of a chart best satisfies the
// Now we need to find out which version of a chart best satisfies the
// dependencies in the Chart.yaml
// dependencies in the Chart.yaml
lock , urls, err := m . resolve ( req , repoNames )
lock , err := m . resolve ( req , repoNames )
if err != nil {
if err != nil {
return err
return err
}
}
// Now we need to fetch every package here into charts/
// Now we need to fetch every package here into charts/
if err := m . downloadAll ( lock . Dependencies , urls ); err != nil {
if err := m . downloadAll ( lock . Dependencies ); err != nil {
return err
return err
}
}
@ -230,7 +230,7 @@ func (m *Manager) loadChartDir() (*chart.Chart, error) {
// resolve takes a list of dependencies and translates them into an exact version to download.
// resolve takes a list of dependencies and translates them into an exact version to download.
//
//
// This returns a lock file, which has all of the dependencies normalized to a specific version.
// This returns a lock file, which has all of the dependencies normalized to a specific version.
func ( m * Manager ) resolve ( req [ ] * chart . Dependency , repoNames map [ string ] string ) ( * chart . Lock , map [ string ] string , error ) {
func ( m * Manager ) resolve ( req [ ] * chart . Dependency , repoNames map [ string ] string ) ( * chart . Lock , error ) {
res := resolver . New ( m . ChartPath , m . RepositoryCache , m . RegistryClient )
res := resolver . New ( m . ChartPath , m . RepositoryCache , m . RegistryClient )
return res . Resolve ( req , repoNames )
return res . Resolve ( req , repoNames )
}
}
@ -239,7 +239,7 @@ func (m *Manager) resolve(req []*chart.Dependency, repoNames map[string]string)
//
//
// It will delete versions of the chart that exist on disk and might cause
// It will delete versions of the chart that exist on disk and might cause
// a conflict.
// a conflict.
func ( m * Manager ) downloadAll ( deps [ ] * chart . Dependency , urls map [ string ] string ) error {
func ( m * Manager ) downloadAll ( deps [ ] * chart . Dependency ) error {
repos , err := m . loadChartRepositories ( )
repos , err := m . loadChartRepositories ( )
if err != nil {
if err != nil {
return err
return err
@ -312,7 +312,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency, urls map[string]string)
// Any failure to resolve/download a chart should fail:
// Any failure to resolve/download a chart should fail:
// https://github.com/helm/helm/issues/1439
// https://github.com/helm/helm/issues/1439
churl , username , password , insecureskiptlsverify , passcredentialsall , caFile , certFile , keyFile , err := m . findChartURL ( dep . Name , dep . Version , dep . Repository , repos , urls )
churl , username , password , insecureskiptlsverify , passcredentialsall , caFile , certFile , keyFile , err := m . findChartURL ( dep . Name , dep . Version , dep . Repository , repos )
if err != nil {
if err != nil {
saveError = errors . Wrapf ( err , "could not find %s" , churl )
saveError = errors . Wrapf ( err , "could not find %s" , churl )
break
break
@ -501,7 +501,6 @@ func (m *Manager) ensureMissingRepos(repoNames map[string]string, deps []*chart.
var ru [ ] * repo . Entry
var ru [ ] * repo . Entry
Outer :
for _ , dd := range deps {
for _ , dd := range deps {
// If the chart is in the local charts directory no repository needs
// If the chart is in the local charts directory no repository needs
@ -529,14 +528,6 @@ Outer:
repoNames [ dd . Name ] = rn
repoNames [ dd . Name ] = rn
// If repository is already present don't add to array. This will skip
// unnecessary index file downloading improving performance.
for _ , item := range ru {
if item . URL == dd . Repository {
continue Outer
}
}
// Assuming the repository is generally available. For Helm managed
// Assuming the repository is generally available. For Helm managed
// access controls the repository needs to be added through the user
// access controls the repository needs to be added through the user
// managed system. This path will work for public charts, like those
// managed system. This path will work for public charts, like those
@ -712,7 +703,7 @@ func (m *Manager) parallelRepoUpdate(repos []*repo.Entry) error {
// repoURL is the repository to search
// repoURL is the repository to search
//
//
// If it finds a URL that is "relative", it will prepend the repoURL.
// If it finds a URL that is "relative", it will prepend the repoURL.
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 ) {
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 ) {
if registry . IsOCI ( repoURL ) {
if registry . IsOCI ( repoURL ) {
return fmt . Sprintf ( "%s/%s:%s" , repoURL , name , version ) , "" , "" , false , false , "" , "" , "" , nil
return fmt . Sprintf ( "%s/%s:%s" , repoURL , name , version ) , "" , "" , false , false , "" , "" , "" , nil
}
}
@ -751,14 +742,7 @@ func (m *Manager) findChartURL(name, version, repoURL string, repos map[string]*
return
return
}
}
}
}
url , err = repo . FindChartInRepoURL ( repoURL , name , version , certFile , keyFile , caFile , m . Getters )
urlsKey := repoURL + name + version
if _ , ok := urls [ urlsKey ] ; ok {
url = urls [ urlsKey ]
} else {
url , err = repo . FindChartInRepoURL ( repoURL , name , version , certFile , keyFile , caFile , m . Getters )
}
if err == nil {
if err == nil {
return url , username , password , false , false , "" , "" , "" , err
return url , username , password , false , false , "" , "" , "" , err
}
}