Update kubectl kustomize to kyaml/v0.14.1, cmd/config/v0.11.1, api/v0.13.2, kustomize/v5.0.1
This commit is contained in:
15
vendor/sigs.k8s.io/kustomize/api/internal/plugins/fnplugin/fnplugin.go
generated
vendored
15
vendor/sigs.k8s.io/kustomize/api/internal/plugins/fnplugin/fnplugin.go
generated
vendored
@@ -7,7 +7,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||
|
||||
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
||||
"sigs.k8s.io/kustomize/api/resmap"
|
||||
@@ -51,13 +51,16 @@ func resourceToRNode(res *resource.Resource) (*yaml.RNode, error) {
|
||||
}
|
||||
|
||||
// GetFunctionSpec return function spec is there is. Otherwise return nil
|
||||
func GetFunctionSpec(res *resource.Resource) *runtimeutil.FunctionSpec {
|
||||
func GetFunctionSpec(res *resource.Resource) (*runtimeutil.FunctionSpec, error) {
|
||||
rnode, err := resourceToRNode(res)
|
||||
if err != nil {
|
||||
return nil
|
||||
return nil, fmt.Errorf("could not convert resource to RNode: %w", err)
|
||||
}
|
||||
|
||||
return runtimeutil.GetFunctionSpec(rnode)
|
||||
functionSpec, err := runtimeutil.GetFunctionSpec(rnode)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get FunctionSpec: %w", err)
|
||||
}
|
||||
return functionSpec, nil
|
||||
}
|
||||
|
||||
func toStorageMounts(mounts []string) []runtimeutil.StorageMount {
|
||||
@@ -191,7 +194,7 @@ func (p *FnPlugin) invokePlugin(input []byte) ([]byte, error) {
|
||||
|
||||
err = p.runFns.Execute()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(
|
||||
return nil, errors.WrapPrefixf(
|
||||
err, "couldn't execute function")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user