Skip to content

Commit 946d1e6

Browse files
committed
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 <[email protected]>
1 parent f60f759 commit 946d1e6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

controllers/helmchart_controller.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,6 @@ func (r *HelmChartReconciler) reconcileFromTarballArtifact(ctx context.Context,
446446
isDir := chartFileInfo.IsDir()
447447
switch {
448448
case isDir:
449-
// Load dependencies
450-
if err = chartutil.ProcessDependencies(helmChart, helmChart.Values); err != nil {
451-
err = fmt.Errorf("failed to process chart dependencies: %w", err)
452-
return sourcev1.HelmChartNotReady(chart, sourcev1.StorageOperationFailedReason, err.Error()), err
453-
}
454-
455449
// Determine chart dependencies
456450
deps := helmChart.Dependencies()
457451
reqs := helmChart.Metadata.Dependencies

controllers/testdata/charts/helmchartwithdeps/Chart.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ dependencies:
2424
- name: helmchart
2525
version: "0.1.0"
2626
repository: "file://../helmchart"
27+
- name: helmchart
28+
alias: aliased
29+
version: "0.1.0"
30+
repository: "file://../helmchart"
2731
- name: grafana
2832
version: ">=5.7.0"
2933
repository: "https://grafana.github.io/helm-charts"

0 commit comments

Comments
 (0)