Upstream/main restructured the dependency error handling in install.go
and upgrade.go from a nested-if block (if DependencyUpdate) to an
early-return pattern (if !DependencyUpdate). Adapt the feature's
Manager construction to match the new code structure.
Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
// Reload the chart with the updated Chart.lock file.
ifchartRequested,err=loader.Load(cp);err!=nil{
returnnil,fmt.Errorf("failed reloading chart after repo update: %w",err)
}
}else{
if!client.DependencyUpdate{
returnnil,fmt.Errorf("an error occurred while checking for chart dependencies. You may need to run 'helm dependency build' to fetch missing dependencies: %w",err)
}
man:=&downloader.Manager{
Out:out,
ChartPath:cp,
Keyring:client.Keyring,
SkipUpdate:false,
Getters:p,
RepositoryConfig:settings.RepositoryConfig,
RepositoryCache:settings.RepositoryCache,
ContentCache:settings.ContentCache,
Debug:settings.Debug,
RegistryClient:client.GetRegistryClient(),
SourceDateEpoch:sourceDateEpoch,
}
iferr:=man.Update();err!=nil{
returnnil,err
}
// Reload the chart with the updated Chart.lock file.
ifchartRequested,err=loader.Load(cp);err!=nil{
returnnil,fmt.Errorf("failed reloading chart after repo update: %w",err)
err=fmt.Errorf("an error occurred while checking for chart dependencies. You may need to run 'helm dependency build' to fetch missing dependencies: %w",err)
ifclient.DependencyUpdate{
man:=&downloader.Manager{
Out:out,
ChartPath:chartPath,
Keyring:client.Keyring,
SkipUpdate:false,
Getters:p,
RepositoryConfig:settings.RepositoryConfig,
RepositoryCache:settings.RepositoryCache,
ContentCache:settings.ContentCache,
Debug:settings.Debug,
SourceDateEpoch:sourceDateEpoch,
}
iferr:=man.Update();err!=nil{
returnerr
}
// Reload the chart with the updated Chart.lock file.
ifch,err=loader.Load(chartPath);err!=nil{
returnfmt.Errorf("failed reloading chart after repo update: %w",err)
}
}else{
if!client.DependencyUpdate{
returnerr
}
man:=&downloader.Manager{
Out:out,
ChartPath:chartPath,
Keyring:client.Keyring,
SkipUpdate:false,
Getters:p,
RepositoryConfig:settings.RepositoryConfig,
RepositoryCache:settings.RepositoryCache,
ContentCache:settings.ContentCache,
Debug:settings.Debug,
SourceDateEpoch:sourceDateEpoch,
}
iferr:=man.Update();err!=nil{
returnerr
}
// Reload the chart with the updated Chart.lock file.
ifch,err=loader.Load(chartPath);err!=nil{
returnfmt.Errorf("failed reloading chart after repo update: %w",err)