fix testcases on runfn_test.go

This commit is contained in:
yugo kobayashi
2022-09-23 07:14:21 +00:00
parent 401cf9579c
commit 6ce230f2b2
2 changed files with 16 additions and 1 deletions

View File

@@ -238,7 +238,7 @@ func getFunctionSpecFromAnnotation(n *yaml.RNode, meta yaml.ResourceMeta) (*Func
}
n, err := n.Pipe(yaml.Lookup("metadata", "configFn"))
if err != nil {
return nil, fmt.Errorf("failed to LookUp configFn: %w", err)
return nil, fmt.Errorf("failed to look up metadata.configFn: %w", err)
}
if yaml.IsMissingOrNull(n) {
return nil, nil

View File

@@ -287,6 +287,21 @@ metadata:
{
explicitFunction: true,
value: `
apiVersion: example.com/v1alpha1
kind: ExampleFunction
metadata:
annotations:
foo: bar
`,
},
},
},
{
name: "invalid input object",
in: []f{
{
explicitFunction: true,
value: `
foo: bar
`,
},