mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Merge pull request #5961 from koba1t/refactor/nested_format_string
refactor: nested format string
This commit is contained in:
@@ -161,12 +161,12 @@ func (p *ExecPlugin) invokePlugin(input []byte) ([]byte, error) {
|
||||
_, err = f.Write(p.cfg)
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(
|
||||
err, "%s", "writing plugin config to "+f.Name())
|
||||
err, "writing plugin config to %s", f.Name())
|
||||
}
|
||||
err = f.Close()
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(
|
||||
err, "%s", "closing plugin config file "+f.Name())
|
||||
err, "closing plugin config file %s", f.Name())
|
||||
}
|
||||
cmd := exec.Command(
|
||||
p.path, append([]string{f.Name()}, p.args...)...)
|
||||
|
||||
@@ -52,9 +52,9 @@ Installation and setup instructions: https://kubernetes.io/docs/tasks/tools/inst
|
||||
command.Stderr = &stderr
|
||||
err := command.Run()
|
||||
if err != nil {
|
||||
return fmt.Errorf("%w\n%s", err, stderr.String()+errMsg)
|
||||
return fmt.Errorf("%w\n%s%s", err, stderr.String(), errMsg)
|
||||
} else if stdout.String() == "" {
|
||||
return fmt.Errorf("%s", stderr.String()+errMsg)
|
||||
return fmt.Errorf("%s%s", stderr.String(), errMsg)
|
||||
}
|
||||
|
||||
// format and output
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
package filesys
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||
@@ -78,7 +77,7 @@ func ConfirmDir(fSys FileSystem, path string) (ConfirmedDir, error) {
|
||||
return "", errors.WrapPrefixf(err, "not a valid directory")
|
||||
}
|
||||
if f != "" {
|
||||
return "", errors.WrapPrefixf(errors.Errorf("file is not directory"), "%s", fmt.Sprintf("'%s'", path))
|
||||
return "", errors.WrapPrefixf(errors.Errorf("file is not directory"), "'%s'", path)
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user