Skip to content

Commit

Permalink
Prune defaults for CRD serving
Browse files Browse the repository at this point in the history
Kubernetes-commit: f2ffbea836f7b232b06281529e75577d82583ec5
  • Loading branch information
Jefftree authored and k8s-publishing-bot committed May 23, 2022
1 parent f6dccd8 commit 819c47e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/openapi/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ func buildVersionSpecs(crd *apiextensionsv1.CustomResourceDefinition, oldSpecs m
if !v.Served {
continue
}
// Defaults are not pruned here, but before being served.
spec, err := builder.BuildOpenAPIV2(crd, v.Name, builder.Options{V2: true})
// Defaults must be pruned here for CRDs to cleanly merge with the static
// spec that already has defaults pruned
spec.Definitions = handler.PruneDefaults(spec.Definitions)
if err != nil {
return nil, false, err
}
Expand Down

0 comments on commit 819c47e

Please sign in to comment.