mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-20 10:28:56 +00:00
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:
13
vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/execplugin.go
generated
vendored
13
vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/execplugin.go
generated
vendored
@@ -6,7 +6,6 @@ package execplugin
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
@@ -14,9 +13,9 @@ import (
|
||||
|
||||
"github.com/google/shlex"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
||||
"sigs.k8s.io/kustomize/api/resmap"
|
||||
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
@@ -150,19 +149,19 @@ func (p *ExecPlugin) Transform(rm resmap.ResMap) error {
|
||||
// passes the full temp file path as the first arg to a process
|
||||
// running the plugin binary. Process output is returned.
|
||||
func (p *ExecPlugin) invokePlugin(input []byte) ([]byte, error) {
|
||||
f, err := ioutil.TempFile("", tmpConfigFilePrefix)
|
||||
f, err := os.CreateTemp("", tmpConfigFilePrefix)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(
|
||||
return nil, errors.WrapPrefixf(
|
||||
err, "creating tmp plugin config file")
|
||||
}
|
||||
_, err = f.Write(p.cfg)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(
|
||||
return nil, errors.WrapPrefixf(
|
||||
err, "writing plugin config to "+f.Name())
|
||||
}
|
||||
err = f.Close()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(
|
||||
return nil, errors.WrapPrefixf(
|
||||
err, "closing plugin config file "+f.Name())
|
||||
}
|
||||
//nolint:gosec
|
||||
@@ -176,7 +175,7 @@ func (p *ExecPlugin) invokePlugin(input []byte) ([]byte, error) {
|
||||
}
|
||||
result, err := cmd.Output()
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(
|
||||
return nil, errors.WrapPrefixf(
|
||||
err, "failure in plugin configured via %s; %v",
|
||||
f.Name(), err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user