Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
007bb9db
Commit
007bb9db
authored
Mar 20, 2017
by
Justin Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement 'exports' convetion for simple list items
parent
2bd4d1d0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
2 deletions
+34
-2
requirements.go
pkg/chartutil/requirements.go
+1
-1
requirements_test.go
pkg/chartutil/requirements_test.go
+12
-0
values.yaml
...data/subpop/charts/subchart1/charts/subchartB/values.yaml
+9
-1
requirements.yaml
...rtutil/testdata/subpop/charts/subchart1/requirements.yaml
+3
-0
values.yaml
pkg/chartutil/testdata/subpop/charts/subchart1/values.yaml
+3
-0
requirements.yaml
pkg/chartutil/testdata/subpop/requirements.yaml
+6
-0
No files found.
pkg/chartutil/requirements.go
View file @
007bb9db
...
@@ -351,7 +351,7 @@ func processImportValues(c *chart.Chart, v *chart.Config) error {
...
@@ -351,7 +351,7 @@ func processImportValues(c *chart.Chart, v *chart.Config) error {
}
}
case
string
:
case
string
:
nm
:=
make
(
map
[
string
]
string
)
nm
:=
make
(
map
[
string
]
string
)
nm
[
"child"
]
=
riv
.
(
string
)
nm
[
"child"
]
=
"exports."
+
riv
.
(
string
)
nm
[
"parent"
]
=
"."
nm
[
"parent"
]
=
"."
outiv
=
append
(
outiv
,
nm
)
outiv
=
append
(
outiv
,
nm
)
s
:=
r
.
Name
+
"."
+
nm
[
"child"
]
s
:=
r
.
Name
+
"."
+
nm
[
"child"
]
...
...
pkg/chartutil/requirements_test.go
View file @
007bb9db
...
@@ -226,6 +226,12 @@ func TestProcessRequirementsImportValues(t *testing.T) {
...
@@ -226,6 +226,12 @@ func TestProcessRequirementsImportValues(t *testing.T) {
e
[
"imported-from-chartA-via-chart1.limits.memory"
]
=
"300Mi"
e
[
"imported-from-chartA-via-chart1.limits.memory"
]
=
"300Mi"
e
[
"imported-from-chartA-via-chart1.limits.volume"
]
=
"11"
e
[
"imported-from-chartA-via-chart1.limits.volume"
]
=
"11"
e
[
"imported-from-chartA-via-chart1.requests.truthiness"
]
=
"0.01"
e
[
"imported-from-chartA-via-chart1.requests.truthiness"
]
=
"0.01"
// single list items (looks for exports. parent key)
e
[
"imported-from-chartB-via-chart1.databint"
]
=
"1"
e
[
"imported-from-chartB-via-chart1.databstr"
]
=
"x.y.z"
e
[
"parent1c3"
]
=
"true"
// checks that a chartb value was merged in with charta values
e
[
"imported-from-chartA-via-chart1.resources.limits.shares"
]
=
"100"
verifyRequirementsImportValues
(
t
,
c
,
v
,
e
)
verifyRequirementsImportValues
(
t
,
c
,
v
,
e
)
}
}
...
@@ -254,6 +260,12 @@ func verifyRequirementsImportValues(t *testing.T, c *chart.Chart, v *chart.Confi
...
@@ -254,6 +260,12 @@ func verifyRequirementsImportValues(t *testing.T, c *chart.Chart, v *chart.Confi
t
.
Errorf
(
"Failed to match imported float value %v with expected %v"
,
s
,
vv
)
t
.
Errorf
(
"Failed to match imported float value %v with expected %v"
,
s
,
vv
)
return
return
}
}
case
bool
:
b
:=
strconv
.
FormatBool
(
pv
.
(
bool
))
if
b
!=
vv
{
t
.
Errorf
(
"Failed to match imported bool value %v with expected %v"
,
b
,
vv
)
return
}
default
:
default
:
if
pv
.
(
string
)
!=
vv
{
if
pv
.
(
string
)
!=
vv
{
t
.
Errorf
(
"Failed to match imported string value %v with expected %v"
,
pv
,
vv
)
t
.
Errorf
(
"Failed to match imported string value %v with expected %v"
,
pv
,
vv
)
...
...
pkg/chartutil/testdata/subpop/charts/subchart1/charts/subchartB/values.yaml
View file @
007bb9db
...
@@ -18,4 +18,12 @@ resources:
...
@@ -18,4 +18,12 @@ resources:
requests
:
requests
:
cpu
:
100m
cpu
:
100m
memory
:
128Mi
memory
:
128Mi
exports
:
convention1
:
data
:
databint
:
1
databstr
:
x.y.z
convention2
:
resources
:
limits
:
shares
:
100
pkg/chartutil/testdata/subpop/charts/subchart1/requirements.yaml
View file @
007bb9db
...
@@ -16,6 +16,9 @@ dependencies:
...
@@ -16,6 +16,9 @@ dependencies:
repository
:
http://localhost:10191
repository
:
http://localhost:10191
version
:
0.1.0
version
:
0.1.0
condition
:
subchartb.enabled
condition
:
subchartb.enabled
import-values
:
-
convention1
-
convention2
tags
:
tags
:
-
front-end
-
front-end
-
subchartb
-
subchartb
pkg/chartutil/testdata/subpop/charts/subchart1/values.yaml
View file @
007bb9db
...
@@ -21,4 +21,7 @@ resources:
...
@@ -21,4 +21,7 @@ resources:
cpu
:
250m
cpu
:
250m
memory
:
250Mi
memory
:
250Mi
truthiness
:
200
truthiness
:
200
exports
:
convention3
:
parent1c3
:
true
pkg/chartutil/testdata/subpop/requirements.yaml
View file @
007bb9db
...
@@ -11,6 +11,12 @@ dependencies:
...
@@ -11,6 +11,12 @@ dependencies:
parent
:
imported-from-chart1
parent
:
imported-from-chart1
-
child
:
imported-from-chartA
-
child
:
imported-from-chartA
parent
:
imported-from-chartA-via-chart1
parent
:
imported-from-chartA-via-chart1
-
convention3
# this merges chartb "shares" into charta "limits"
-
child
:
resources.limits
parent
:
imported-from-chartA-via-chart1.resources.limits
-
child
:
data
parent
:
imported-from-chartB-via-chart1
-
name
:
subchart2
-
name
:
subchart2
repository
:
http://localhost:10191
repository
:
http://localhost:10191
version
:
0.1.0
version
:
0.1.0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment