fix: adapt SourceDateEpoch to upstream refactored dep check

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>
pull/32162/head
Lohit Kolluri 3 months ago
parent 88b6ecbf44
commit 59c72bd6a4
No known key found for this signature in database

@ -305,7 +305,9 @@ func runInstall(args []string, client *action.Install, valueOpts *values.Options
// As of Helm 2.4.0, this is treated as a stopping condition:
// https://github.com/helm/helm/issues/2209
if err := action.CheckDependencies(chartRequested, req); err != nil {
if client.DependencyUpdate {
if !client.DependencyUpdate {
return nil, 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,
@ -326,9 +328,6 @@ func runInstall(args []string, client *action.Install, valueOpts *values.Options
if chartRequested, err = loader.Load(cp); err != nil {
return nil, fmt.Errorf("failed reloading chart after repo update: %w", err)
}
} else {
return nil, fmt.Errorf("an error occurred while checking for chart dependencies. You may need to run 'helm dependency build' to fetch missing dependencies: %w", err)
}
}
}

@ -210,7 +210,9 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
}
if err := action.CheckDependencies(ch, req); err != nil {
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)
if client.DependencyUpdate {
if !client.DependencyUpdate {
return err
}
man := &downloader.Manager{
Out: out,
ChartPath: chartPath,
@ -230,9 +232,6 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
if ch, err = loader.Load(chartPath); err != nil {
return fmt.Errorf("failed reloading chart after repo update: %w", err)
}
} else {
return err
}
}
}

Loading…
Cancel
Save