mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
improve error messages
This commit is contained in:
@@ -105,7 +105,7 @@ func (lc *localizer) load() (*types.Kustomization, string, error) {
|
||||
var kust types.Kustomization
|
||||
err = (&kust).Unmarshal(content)
|
||||
if err != nil {
|
||||
return nil, "", errors.WrapPrefixf(err, "invalid kustomization")
|
||||
return nil, "", errors.Wrap(err)
|
||||
}
|
||||
|
||||
// Localize intentionally does not replace legacy fields to return a localized kustomization
|
||||
|
||||
@@ -228,7 +228,7 @@ suffix: invalid`,
|
||||
|
||||
err := Run("/a", "", "", fSysTest)
|
||||
require.EqualError(t, err,
|
||||
`unable to localize target "/a": invalid kustomization: kustomization unmarshal error: error unmarshaling JSON: while decoding JSON: json: unknown field "suffix"`)
|
||||
`unable to localize target "/a": invalid Kustomization: error unmarshaling JSON: while decoding JSON: json: unknown field "suffix"`)
|
||||
|
||||
checkFSys(t, fSysExpected, fSysTest)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user