Only create SSA models for CRDs with structural schema

And also, the current code only understands V2, so we should use that
exclusively, or we're guaranteed to have errors in the future.
This commit is contained in:
Antoine Pelisse 2020-04-30 14:45:06 -07:00 committed by Jefftree
parent e1c617a88e
commit aebb47e7f4

View File

@ -1320,8 +1320,7 @@ func buildOpenAPIModelsForApply(staticOpenAPISpec *goopenapispec.Swagger, crd *a
specs := []*goopenapispec.Swagger{}
for _, v := range crd.Spec.Versions {
// Defaults are not pruned here, but before being served.
s, err := builder.BuildSwagger(crd, v.Name, builder.Options{V2: false, StripValueValidation: true, StripNullable: true, AllowNonStructural: true})
s, err := builder.BuildSwagger(crd, v.Name, builder.Options{V2: true, StripValueValidation: true, StripNullable: true, AllowNonStructural: false})
if err != nil {
return nil, err
}