replaceVars returns nil on nil input, not error

includes  an integration test for 'null' args inputs
This commit is contained in:
Andrew Lavery
2019-01-30 14:52:07 -08:00
parent 093801479c
commit 1d263d24dd
2 changed files with 80 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ func (rv *refvarTransformer) replaceVars(in interface{}) (interface{}, error) {
return nil, fmt.Errorf("%#v is expected to be %T", in, s)
}
return expansion.Expand(s, rv.mappingFunc), nil
case nil:
return nil, nil
default:
return "", fmt.Errorf("invalid type encountered %T", vt)
}