Skip to content

Commit

Permalink
Issues mittwald#78 mittwald#79 mittwald#80 addressed and fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen committed Apr 26, 2022
1 parent 84603c8 commit edde7e5
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ func (c *HelmClient) install(ctx context.Context, spec *ChartSpec) (*release.Rel
if err := man.Update(); err != nil {
return nil, err
}

helmChart, chartPath, err = c.getChart(spec.ChartName, &client.ChartPathOptions)
if err != nil {
return nil, err
}

} else {
return nil, err
}
Expand Down Expand Up @@ -361,7 +367,28 @@ func (c *HelmClient) upgrade(ctx context.Context, spec *ChartSpec) (*release.Rel

if req := helmChart.Metadata.Dependencies; req != nil {
if err := action.CheckDependencies(helmChart, req); err != nil {
return nil, err
if client.DependencyUpdate {
man := &downloader.Manager{
ChartPath: chartPath,
Keyring: client.ChartPathOptions.Keyring,
SkipUpdate: false,
Getters: c.Providers,
RepositoryConfig: c.Settings.RepositoryConfig,
RepositoryCache: c.Settings.RepositoryCache,
Out: c.output,
}
if err := man.Update(); err != nil {
return nil, err
}

helmChart, chartPath, err = c.getChart(spec.ChartName, &client.ChartPathOptions)
if err != nil {
return nil, err
}

} else {
return nil, err
}
}
}

Expand Down Expand Up @@ -489,10 +516,17 @@ func (c *HelmClient) TemplateChart(spec *ChartSpec) ([]byte, error) {
Getters: c.Providers,
RepositoryConfig: c.Settings.RepositoryConfig,
RepositoryCache: c.Settings.RepositoryCache,
Out: c.output,
}
if err := man.Update(); err != nil {
return nil, err
}

helmChart, chartPath, err = c.getChart(spec.ChartName, &client.ChartPathOptions)
if err != nil {
return nil, err
}

} else {
return nil, err
}
Expand Down Expand Up @@ -831,6 +865,7 @@ func mergeUpgradeOptions(chartSpec *ChartSpec, upgradeOptions *action.Upgrade) {
upgradeOptions.Namespace = chartSpec.Namespace
upgradeOptions.Timeout = chartSpec.Timeout
upgradeOptions.Wait = chartSpec.Wait
upgradeOptions.DependencyUpdate = chartSpec.DependencyUpdate
upgradeOptions.DisableHooks = chartSpec.DisableHooks
upgradeOptions.Force = chartSpec.Force
upgradeOptions.ResetValues = chartSpec.ResetValues
Expand Down

0 comments on commit edde7e5

Please sign in to comment.