kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
319 stars 208 forks source link

Deduplicate parameters via references #411

Closed sttts closed 1 year ago

sttts commented 1 year ago

Parameters are large part of the Kubernetes OpenAPI v2 spec. This PR moves parameter definition into the global parameters section of the spec. It also add deconflicting (renaming) support on spec merge if parameters of the same name differ.

As renaming in deconflicting might create noise, we make parameter names mostly unique through name-<base64(sha224(parameter-json))[:8]>. So the deconflicting is still in place as there might be conflicts. But in practice this probably won't happen.

Proof PR https://github.com/kubernetes/kubernetes/pull/118204

sttts commented 1 year ago

/assign @Jefftree @apelisse

apelisse commented 1 year ago

I don't know if I have anything, I haven't given a deep deep look, @Jefftree can I leave it to you?

Jefftree commented 1 year ago

I don't know if I have anything, I haven't given a deep deep look, @Jefftree can I leave it to you?

Of course

Jefftree commented 1 year ago

/lgtm /approve /hold

One small nit for comment typo, not really blocking so feel free to merge and follow up if it's more convenient.

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

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

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,sttts] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
sttts commented 1 year ago

/hold cancel

Jefftree commented 1 year ago

/lgtm