Skip to content

Commit 0ceec2d

Browse files
committed
Add test case for set with boolean value and set-string behavior
Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
1 parent c0f72e1 commit 0ceec2d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

controllers/helmrelease_controller_test.go

+46
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,52 @@ other: values
107107
},
108108
},
109109
},
110+
{
111+
name: "target path with boolean value",
112+
resources: []runtime.Object{
113+
valuesSecret("values", map[string][]byte{"single": []byte("true")}),
114+
},
115+
references: []v2.ValuesReference{
116+
{
117+
Kind: "Secret",
118+
Name: "values",
119+
ValuesKey: "single",
120+
TargetPath: "merge.at.specific.path",
121+
},
122+
},
123+
want: chartutil.Values{
124+
"merge": map[string]interface{}{
125+
"at": map[string]interface{}{
126+
"specific": map[string]interface{}{
127+
"path": true,
128+
},
129+
},
130+
},
131+
},
132+
},
133+
{
134+
name: "target path with set-string behavior",
135+
resources: []runtime.Object{
136+
valuesSecret("values", map[string][]byte{"single": []byte("\"true\"")}),
137+
},
138+
references: []v2.ValuesReference{
139+
{
140+
Kind: "Secret",
141+
Name: "values",
142+
ValuesKey: "single",
143+
TargetPath: "merge.at.specific.path",
144+
},
145+
},
146+
want: chartutil.Values{
147+
"merge": map[string]interface{}{
148+
"at": map[string]interface{}{
149+
"specific": map[string]interface{}{
150+
"path": "true",
151+
},
152+
},
153+
},
154+
},
155+
},
110156
{
111157
name: "values reference to non existing secret",
112158
references: []v2.ValuesReference{

0 commit comments

Comments
 (0)