Skip to content

Commit

Permalink
fix testcases on runfn_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
koba1t committed Sep 23, 2022
1 parent 401cf95 commit 6ce230f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kyaml/fn/runtime/runtimeutil/functiontypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions kyaml/runfn/runfn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`,
},
Expand Down

0 comments on commit 6ce230f

Please sign in to comment.