@@ -210,7 +210,9 @@ func (g *generator) genGroupVersion(name string, version generation.APIVersionCo
210
210
211
211
for _ , crdResults := range runResults .CRDValidation {
212
212
for _ , err := range crdResults .Errors {
213
- result .Errors = append (result .Errors , fmt .Errorf ("%s: %w" , crdResults .Name , errors .New (err )))
213
+ resErr := fmt .Errorf ("%s: %w" , crdResults .Name , errors .New (err ))
214
+ result .Errors = append (result .Errors , resErr )
215
+ errs = append (errs , resErr )
214
216
}
215
217
216
218
for _ , warn := range crdResults .Warnings {
@@ -220,7 +222,9 @@ func (g *generator) genGroupVersion(name string, version generation.APIVersionCo
220
222
221
223
versionedResultFunc := func (version , property string , compResult validations.ComparisonResult ) {
222
224
for _ , err := range compResult .Errors {
223
- result .Errors = append (result .Errors , fmt .Errorf ("(%s) %s - %s: %w" , version , property , compResult .Name , errors .New (err )))
225
+ resErr := fmt .Errorf ("(%s) %s - %s: %w" , version , property , compResult .Name , errors .New (err ))
226
+ result .Errors = append (result .Errors , resErr )
227
+ errs = append (errs , resErr )
224
228
}
225
229
226
230
for _ , warn := range compResult .Warnings {
@@ -234,6 +238,10 @@ func (g *generator) genGroupVersion(name string, version generation.APIVersionCo
234
238
results = append (results , result )
235
239
}
236
240
241
+ if len (errs ) > 0 {
242
+ return results , kerrors .NewAggregate (errs )
243
+ }
244
+
237
245
return results , nil
238
246
}
239
247
0 commit comments