mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
fix testcases on runfn_test.go
This commit is contained in:
@@ -238,7 +238,7 @@ func getFunctionSpecFromAnnotation(n *yaml.RNode, meta yaml.ResourceMeta) (*Func
|
|||||||
}
|
}
|
||||||
n, err := n.Pipe(yaml.Lookup("metadata", "configFn"))
|
n, err := n.Pipe(yaml.Lookup("metadata", "configFn"))
|
||||||
if err != nil {
|
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) {
|
if yaml.IsMissingOrNull(n) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|||||||
@@ -287,6 +287,21 @@ metadata:
|
|||||||
{
|
{
|
||||||
explicitFunction: true,
|
explicitFunction: true,
|
||||||
value: `
|
value: `
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: ExampleFunction
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
foo: bar
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "invalid input object",
|
||||||
|
in: []f{
|
||||||
|
{
|
||||||
|
explicitFunction: true,
|
||||||
|
value: `
|
||||||
foo: bar
|
foo: bar
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user