mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
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:
parent
e1c617a88e
commit
aebb47e7f4
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user