Remove use of chartutil.ProcessDependencies

It looks like the use of chartutil.ProcessDependencies in the HelmChart
Controller was not correct, this method seems to be used in Helm only
during install/upgrade. The intention was to load the dependencies but
this seems to not be needed as it's already done through the loaders
(loader.Load).

The use of this method caused a regression where Chart.yaml files would
be overwritten and registered subcharts that had aliases would be
renamed using the alias name. While this is an expected behaviour of
chartutil.ProcessDependencies it is not what the controller should do
to the chart during (re)packaging.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
This commit is contained in:
Aurel Canciu 2020-10-30 19:08:41 +02:00
parent f60f7591e1
commit 946d1e6ac0
No known key found for this signature in database
GPG Key ID: AB25339971E6F81E
2 changed files with 4 additions and 6 deletions

View File

@ -446,12 +446,6 @@ func (r *HelmChartReconciler) reconcileFromTarballArtifact(ctx context.Context,
isDir := chartFileInfo.IsDir()
switch {
case isDir:
// Load dependencies
if err = chartutil.ProcessDependencies(helmChart, helmChart.Values); err != nil {
err = fmt.Errorf("failed to process chart dependencies: %w", err)
return sourcev1.HelmChartNotReady(chart, sourcev1.StorageOperationFailedReason, err.Error()), err
}
// Determine chart dependencies
deps := helmChart.Dependencies()
reqs := helmChart.Metadata.Dependencies

View File

@ -24,6 +24,10 @@ dependencies:
- name: helmchart
version: "0.1.0"
repository: "file://../helmchart"
- name: helmchart
alias: aliased
version: "0.1.0"
repository: "file://../helmchart"
- name: grafana
version: ">=5.7.0"
repository: "https://grafana.github.io/helm-charts"