diff --git a/requirements.go b/requirements.go index 26cb1a1..e3620c2 100644 --- a/requirements.go +++ b/requirements.go @@ -13,12 +13,14 @@ type Requirements struct { } type Dependency struct { - Name string `yaml:"name,omitempty"` - Repository string `yaml:"repository,omitempty"` - Condition string `yaml:"condition,omitempty"` - Alias string `yaml:"alias,omitempty"` - Version string `yaml:"version,omitempty"` - ImportValues []string `yaml:"import-values,omitempty"` + Name string `yaml:"name,omitempty"` + Repository string `yaml:"repository,omitempty"` + Condition string `yaml:"condition,omitempty"` + Alias string `yaml:"alias,omitempty"` + Version string `yaml:"version,omitempty"` + // ImportValues holds the mapping of source values to parent key to be imported. Each item can be a + // string or pair of child/parent sublist items. + ImportValues []interface{} `yaml:"import-values,omitempty"` } type ChartDependency struct { diff --git a/testdata/charts/importvalues/Chart.yaml b/testdata/charts/importvalues/Chart.yaml index e9159fe..4992e34 100644 --- a/testdata/charts/importvalues/Chart.yaml +++ b/testdata/charts/importvalues/Chart.yaml @@ -9,3 +9,5 @@ dependencies: version: 1.0.0 import-values: - data + - child: data + parent: data diff --git a/testdata/charts/importvalues/charts/mydep-1.0.0.tgz b/testdata/charts/importvalues/charts/mydep-1.0.0.tgz index d556552..2f8f8c1 100644 Binary files a/testdata/charts/importvalues/charts/mydep-1.0.0.tgz and b/testdata/charts/importvalues/charts/mydep-1.0.0.tgz differ diff --git a/testdata/charts/importvalues/mydep/values.yaml b/testdata/charts/importvalues/mydep/values.yaml index 5020230..b09aef0 100644 --- a/testdata/charts/importvalues/mydep/values.yaml +++ b/testdata/charts/importvalues/mydep/values.yaml @@ -1,3 +1,6 @@ exports: data: myval: FOO + +data: + myval: BAR diff --git a/testdata/charts/importvalues/templates/configmap.yaml b/testdata/charts/importvalues/templates/configmap.yaml index 7a53a82..6d580db 100644 --- a/testdata/charts/importvalues/templates/configmap.yaml +++ b/testdata/charts/importvalues/templates/configmap.yaml @@ -5,3 +5,4 @@ metadata: namespace: {{ .Release.Namespace }} data: foo: {{ .Values.myval }} + bar: {{ .Values.data.myval }} diff --git a/testdata/integration/testcases/local_chart_with_import_values/want b/testdata/integration/testcases/local_chart_with_import_values/want index cb8724d..fe5ff6b 100644 --- a/testdata/integration/testcases/local_chart_with_import_values/want +++ b/testdata/integration/testcases/local_chart_with_import_values/want @@ -7,3 +7,4 @@ metadata: namespace: default data: foo: FOO + bar: BAR