diff --git a/pkg/chart/v2/util/dependencies.go b/pkg/chart/v2/util/dependencies.go index a52f09f82..c92ab5085 100644 --- a/pkg/chart/v2/util/dependencies.go +++ b/pkg/chart/v2/util/dependencies.go @@ -279,7 +279,11 @@ func processImportValues(c *chart.Chart, merge bool) error { }) // get child table - vv, err := cvals.Table(r.Name + "." + child) + ref := r.Name + "." + child + if child == "." { + ref = r.Name + } + vv, err := cvals.Table(ref) if err != nil { slog.Warn("ImportValues missing table from chart", "chart", r.Name, slog.Any("error", err)) continue diff --git a/pkg/chart/v2/util/dependencies_test.go b/pkg/chart/v2/util/dependencies_test.go index c817b0b89..f40cedb03 100644 --- a/pkg/chart/v2/util/dependencies_test.go +++ b/pkg/chart/v2/util/dependencies_test.go @@ -213,6 +213,17 @@ func TestProcessDependencyImportValues(t *testing.T) { e["overridden-chartA-B.SCBextra1"] = "13" e["overridden-chartA-B.SC1extra6"] = "77" + e["all.service.name"] = "nginx" + e["all.service.type"] = "ClusterIP" + e["all.service.externalPort"] = "80" + e["all.service.internalPort"] = "80" + e["all.SC1data.SC1bool"] = "true" + e["all.imported-chartA.SC1extra2"] = "1.337" + e["all.overridden-chartA.SCAbool"] = "true" + e["all.imported-chartA-B.SC1extra5"] = "tiller" + e["all.overridden-chartA-B.SCAbool"] = "true" + e["all.SCBexported1A.SC1extra7"] = "true" + // `exports` style e["SCBexported1B"] = "1965" e["SC1extra7"] = "true" diff --git a/pkg/chart/v2/util/testdata/subpop/Chart.yaml b/pkg/chart/v2/util/testdata/subpop/Chart.yaml index 27118672a..7459e0575 100644 --- a/pkg/chart/v2/util/testdata/subpop/Chart.yaml +++ b/pkg/chart/v2/util/testdata/subpop/Chart.yaml @@ -25,6 +25,8 @@ dependencies: parent: . - SCBexported2 - SC1exported1 + - child: . + parent: all - name: subchart2 repository: http://localhost:10191