+16
-2
lines changedFilter options
+16
-2
lines changed Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ limitations under the License.
16
16
package chartutil
17
17
18
18
import (
19
+
"fmt"
19
20
"log"
20
21
"strings"
21
22
@@ -255,8 +256,8 @@ func processImportValues(c *chart.Chart, merge bool) error {
255
256
for _, riv := range r.ImportValues {
256
257
switch iv := riv.(type) {
257
258
case map[string]interface{}:
258
-
child := iv["child"].(string)
259
-
parent := iv["parent"].(string)
259
+
child := fmt.Sprintf("%v", iv["child"])
260
+
parent := fmt.Sprintf("%v", iv["parent"])
260
261
261
262
outiv = append(outiv, map[string]string{
262
263
"child": child,
Original file line number Diff line number Diff line change
@@ -151,6 +151,9 @@ func validateChartVersion(cf *chart.Metadata) error {
151
151
152
152
func validateChartMaintainer(cf *chart.Metadata) error {
153
153
for _, maintainer := range cf.Maintainers {
154
+
if maintainer == nil {
155
+
return errors.New("a maintainer entry is empty")
156
+
}
154
157
if maintainer.Name == "" {
155
158
return errors.New("each maintainer requires a name")
156
159
} else if maintainer.Email != "" && !govalidator.IsEmail(maintainer.Email) {
Original file line number Diff line number Diff line change
@@ -143,6 +143,16 @@ func TestValidateChartMaintainer(t *testing.T) {
143
143
t.Errorf("validateChartMaintainer(%s, %s) to return no error, got %s", test.Name, test.Email, err.Error())
144
144
}
145
145
}
146
+
147
+
// Testing for an empty maintainer
148
+
badChart.Maintainers = []*chart.Maintainer{nil}
149
+
err := validateChartMaintainer(badChart)
150
+
if err == nil {
151
+
t.Errorf("validateChartMaintainer did not return error for nil maintainer as expected")
152
+
}
153
+
if err.Error() != "a maintainer entry is empty" {
154
+
t.Errorf("validateChartMaintainer returned unexpected error for nil maintainer: %s", err.Error())
155
+
}
146
156
}
147
157
148
158
func TestValidateChartSources(t *testing.T) {
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4