mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
Add PrintPluginEnv plugin.
This commit is contained in:
@@ -70,18 +70,6 @@ func NewKustTarget(
|
||||
}, nil
|
||||
}
|
||||
|
||||
func quoted(l []string) []string {
|
||||
r := make([]string, len(l))
|
||||
for i, v := range l {
|
||||
r[i] = "'" + v + "'"
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func commaOr(q []string) string {
|
||||
return strings.Join(q[:len(q)-1], ", ") + " or " + q[len(q)-1]
|
||||
}
|
||||
|
||||
func loadKustFile(ldr ifc.Loader) ([]byte, error) {
|
||||
var content []byte
|
||||
match := 0
|
||||
@@ -103,30 +91,6 @@ func loadKustFile(ldr ifc.Loader) ([]byte, error) {
|
||||
}
|
||||
}
|
||||
|
||||
type errMissingKustomization struct {
|
||||
path string
|
||||
}
|
||||
|
||||
func (e *errMissingKustomization) Error() string {
|
||||
return fmt.Sprintf(
|
||||
"unable to find one of %v in directory '%s'",
|
||||
commaOr(quoted(konfig.RecognizedKustomizationFileNames())),
|
||||
e.path)
|
||||
}
|
||||
|
||||
func NewErrMissingKustomization(p string) *errMissingKustomization {
|
||||
return &errMissingKustomization{path: p}
|
||||
}
|
||||
|
||||
func IsMissingKustomizationFileError(err error) bool {
|
||||
_, ok := err.(*errMissingKustomization)
|
||||
if ok {
|
||||
return true
|
||||
}
|
||||
_, ok = errors.Cause(err).(*errMissingKustomization)
|
||||
return ok
|
||||
}
|
||||
|
||||
func unmarshal(y []byte, o interface{}) error {
|
||||
j, err := yaml.YAMLToJSON(y)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user