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:
natasha41575
2023-03-14 11:40:28 -05:00
parent a9008b502d
commit 09e6e4db1d
128 changed files with 40423 additions and 39692 deletions

View File

@@ -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")
}