Configure wrapcheck linter to recognize wrapping done by kyaml's errors package

This commit is contained in:
Katrina Verey
2022-05-09 16:40:48 -04:00
parent 2e230b4d4b
commit 7a773a3a48
2 changed files with 15 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ func LoadFunctionConfig(src *yaml.RNode, api interface{}) error {
if err != nil {
return errors.WrapPrefixf(err, "loading provided schema")
}
schemaValidationError = validate.AgainstSchema(schema, src, strfmt.Default)
schemaValidationError = errors.Wrap(validate.AgainstSchema(schema, src, strfmt.Default))
// don't return it yet--try to make it to custom validation stage to combine errors
}
@@ -166,7 +166,7 @@ func LoadFunctionConfig(src *yaml.RNode, api interface{}) error {
if d, ok := api.(Defaulter); ok {
if err := d.Default(); err != nil {
return err
return errors.Wrap(err)
}
}