Skip to content

Commit 966614a

Browse files
authored
fix: add child/parent support to import-values (#112)
Signed-off-by: GitHub <[email protected]>
1 parent 96a81a4 commit 966614a

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

requirements.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ type Requirements struct {
1313
}
1414

1515
type Dependency struct {
16-
Name string `yaml:"name,omitempty"`
17-
Repository string `yaml:"repository,omitempty"`
18-
Condition string `yaml:"condition,omitempty"`
19-
Alias string `yaml:"alias,omitempty"`
20-
Version string `yaml:"version,omitempty"`
21-
ImportValues []string `yaml:"import-values,omitempty"`
16+
Name string `yaml:"name,omitempty"`
17+
Repository string `yaml:"repository,omitempty"`
18+
Condition string `yaml:"condition,omitempty"`
19+
Alias string `yaml:"alias,omitempty"`
20+
Version string `yaml:"version,omitempty"`
21+
// ImportValues holds the mapping of source values to parent key to be imported. Each item can be a
22+
// string or pair of child/parent sublist items.
23+
ImportValues []interface{} `yaml:"import-values,omitempty"`
2224
}
2325

2426
type ChartDependency struct {

testdata/charts/importvalues/Chart.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ dependencies:
99
version: 1.0.0
1010
import-values:
1111
- data
12+
- child: data
13+
parent: data
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
exports:
22
data:
33
myval: FOO
4+
5+
data:
6+
myval: BAR

testdata/charts/importvalues/templates/configmap.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ metadata:
55
namespace: {{ .Release.Namespace }}
66
data:
77
foo: {{ .Values.myval }}
8+
bar: {{ .Values.data.myval }}

testdata/integration/testcases/local_chart_with_import_values/want

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ metadata:
77
namespace: default
88
data:
99
foo: FOO
10+
bar: BAR

0 commit comments

Comments
 (0)