Skip to content

Commit

Permalink
fix: add child/parent support to import-values
Browse files Browse the repository at this point in the history
  • Loading branch information
scodeman committed Feb 4, 2025
1 parent 96a81a4 commit 95c4776
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions testdata/charts/importvalues/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ dependencies:
version: 1.0.0
import-values:
- data
- child: myval2
parent: myval2
Binary file modified testdata/charts/importvalues/charts/mydep-1.0.0.tgz
Binary file not shown.
2 changes: 2 additions & 0 deletions testdata/charts/importvalues/mydep/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
exports:
data:
myval: FOO

myval2: BAR
1 change: 1 addition & 0 deletions testdata/charts/importvalues/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ metadata:
namespace: {{ .Release.Namespace }}
data:
foo: {{ .Values.myval }}
bar: {{ .Values.myval2 }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ metadata:
namespace: default
data:
foo: FOO
bar: BAR

0 comments on commit 95c4776

Please sign in to comment.