tpl: Change error message on missing resource
authorSam Smith <sams96@mail.com>
Sun, 1 Mar 2020 22:00:28 +0000 (22:00 +0000)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 2 Mar 2020 17:46:14 +0000 (18:46 +0100)
Fixes #6942

tpl/resources/resources.go

index fd0ffc5ece01a7f3a65ec57f7698cc7c812e3ef1..be10510f2b45bc19f3c8f112b6c1909ef4d29ec1 100644 (file)
@@ -299,6 +299,9 @@ func (ns *Namespace) resolveArgs(args []interface{}) (resources.ResourceTransfor
 
        r, ok := args[1].(resources.ResourceTransformer)
        if !ok {
+               if _, ok := args[1].(map[string]interface{}); !ok {
+                       return nil, nil, fmt.Errorf("no Resource provided in transformation")
+               }
                return nil, nil, fmt.Errorf("type %T not supported in Resource transformations", args[0])
        }