Allow nil label and annotaion

This fix is to allow value of lable or annoation to be nil
This commit is contained in:
Jian Qiu
2019-05-21 13:55:19 +08:00
parent 72f565d55d
commit 5e33ac4a09
2 changed files with 48 additions and 1 deletions

View File

@@ -76,7 +76,9 @@ func (o *mapTransformer) Transform(m resmap.ResMap) error {
func (o *mapTransformer) addMap(in interface{}) (interface{}, error) {
m, ok := in.(map[string]interface{})
if !ok {
if in == nil {
m = map[string]interface{}{}
} else if !ok {
return nil, fmt.Errorf("%#v is expected to be %T", in, m)
}
for k, v := range o.m {