kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
317 stars 205 forks source link

Support PostProcessSpec hook in V3 #439

Closed ryantxu closed 9 months ago

ryantxu commented 9 months ago

Updated https://github.com/kubernetes/kube-openapi/pull/420 -- this time with the config on on OpenAPIV3Config


Currently, the PostProcessSpec hook is only called when creating v2, but does not work for V3. This PR adds an additional hook and calls it while creating the spec.

While building an agregated api-server I am able to apply my special needs to the V2 spec, but not v3. The call is initiated from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/server/routes/openapi.go#L68 so I think it makes most sense to hook in here, but also open to any other suggestions!

Jefftree commented 9 months ago

/lgtm /approve

k8s-ci-robot commented 9 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jefftree, ryantxu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/kube-openapi/blob/master/OWNERS)~~ [Jefftree] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment