Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add child/parent support to import-values #112

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
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: data
parent: data
Binary file modified testdata/charts/importvalues/charts/mydep-1.0.0.tgz
Binary file not shown.
3 changes: 3 additions & 0 deletions testdata/charts/importvalues/mydep/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
exports:
data:
myval: FOO

data:
myval: 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.data.myval }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ metadata:
namespace: default
data:
foo: FOO
bar: BAR
Loading