@ -43,6 +43,7 @@ import (
"helm.sh/helm/v4/pkg/helmpath"
"helm.sh/helm/v4/pkg/helmpath"
"helm.sh/helm/v4/pkg/registry"
"helm.sh/helm/v4/pkg/registry"
"helm.sh/helm/v4/pkg/repo/v1"
"helm.sh/helm/v4/pkg/repo/v1"
pkgchart "helm.sh/helm/v4/pkg/chart"
)
)
// ErrRepoNotFound indicates that chart repositories can't be found in local repo cache.
// ErrRepoNotFound indicates that chart repositories can't be found in local repo cache.
@ -315,7 +316,8 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
// 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 )
depAccessor , _ := pkgchart . NewDependencyAccessor ( dep )
churl , username , password , insecureSkipTLSVerify , passCredentialsAll , caFile , certFile , keyFile , err := m . findChartURL ( dep . Name , dep . Version , depAccessor . Digest ( ) , dep . Repository , repos )
if err != nil {
if err != nil {
saveError = fmt . Errorf ( "could not find %s: %w" , churl , err )
saveError = fmt . Errorf ( "could not find %s: %w" , churl , err )
break
break
@ -725,8 +727,11 @@ 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 ) ( url , username , password string , insecureSkipTLSVerify , passCredentialsAll bool , caFile , certFile , keyFile string , err error ) {
func ( m * Manager ) findChartURL ( name , version , digest, 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 ) {
if digest != "" {
return fmt . Sprintf ( "%s/%s@%s" , repoURL , name , digest ) , "" , "" , false , false , "" , "" , "" , nil
}
return fmt . Sprintf ( "%s/%s:%s" , repoURL , name , version ) , "" , "" , false , false , "" , "" , "" , nil
return fmt . Sprintf ( "%s/%s:%s" , repoURL , name , version ) , "" , "" , false , false , "" , "" , "" , nil
}
}