diff --git a/requirements.go b/requirements.go index 26cb1a1..eaa3d2e 100644 --- a/requirements.go +++ b/requirements.go @@ -18,7 +18,9 @@ type Dependency struct { Condition string `yaml:"condition,omitempty"` Alias string `yaml:"alias,omitempty"` Version string `yaml:"version,omitempty"` - ImportValues []string `yaml:"import-values,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{} `json:"import-values,omitempty"` } type ChartDependency struct { diff --git a/testdata/charts/importvalues/Chart.yaml b/testdata/charts/importvalues/Chart.yaml index e9159fe..1f0c920 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: myval2 + parent: myval2 diff --git a/testdata/charts/importvalues/charts/mydep-1.0.0.tgz b/testdata/charts/importvalues/charts/mydep-1.0.0.tgz index d556552..e95761e 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..0057584 100644 --- a/testdata/charts/importvalues/mydep/values.yaml +++ b/testdata/charts/importvalues/mydep/values.yaml @@ -1,3 +1,5 @@ exports: data: myval: FOO + +myval2: BAR diff --git a/testdata/charts/importvalues/templates/configmap.yaml b/testdata/charts/importvalues/templates/configmap.yaml index 7a53a82..a613ce6 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.myval2 }} 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