Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sig-api-machinery KEP: Vanilla OpenAPI subset: structural schema #1002

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Apr 25, 2019

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 25, 2019
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Apr 25, 2019
@sttts sttts force-pushed the sttts-structural-schema branch 15 times, most recently from 411ad42 to 301f222 Compare April 25, 2019 14:40
@sttts
Copy link
Contributor Author

sttts commented Apr 25, 2019

/assign @liggitt

@sttts
Copy link
Contributor Author

sttts commented Apr 25, 2019

/assign @apelisse @DirectXMan12 @mbohlool

keps/sig-api-machinery/20190425-structural-openapi.md Outdated Show resolved Hide resolved

Note: the OpenAPI v2 output given above is the same we get from the [OpenAPI v2 filtering in Kubernetes 1.14](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/conversion.go#L30): that filtering in the CRD OpenAPI v2 publishing pipeline supports the unrestricted range of the CRD OpenAPI v3 language and turns it into a weaker variant understandable by kubectl 1.13 and 1.14. Hence, our changes above have no influence on the OpenAPI v2 publishing other than passing through of our new `x-kubernetes-*` vendor extensions.

Also note that structural schemas enforce types and properties outside of logical junctors. OpenAPI v2 publishing will preserve these and hence, structural schemas lead to a more complete OpenAPI v2 spec, client-side validation and `kubectl explain` output.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roycaihw ^^ is a great improvement for your publishing code.

keps/sig-api-machinery/20190425-structural-openapi.md Outdated Show resolved Hide resolved
keps/sig-api-machinery/20190425-structural-openapi.md Outdated Show resolved Hide resolved
keps/sig-api-machinery/20190425-structural-openapi.md Outdated Show resolved Hide resolved
keps/sig-api-machinery/20190425-structural-openapi.md Outdated Show resolved Hide resolved
keps/sig-api-machinery/20190425-structural-openapi.md Outdated Show resolved Hide resolved
@liggitt
Copy link
Member

liggitt commented Apr 29, 2019

looks great overall. a few nits and clarifications. only one substantial question at #1002 (comment)

@liggitt
Copy link
Member

liggitt commented Apr 29, 2019

lgtm, can squash when other reviewers are happy

@DirectXMan12
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2019
@sttts
Copy link
Contributor Author

sttts commented Apr 29, 2019

Squashed

@sttts
Copy link
Contributor Author

sttts commented Apr 29, 2019

@DirectXMan12 @liggitt please reapply the tag after squashing.

@DirectXMan12
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2019
@sttts
Copy link
Contributor Author

sttts commented Apr 29, 2019

@lavalamp @deads2k please take a look for approval. @liggitt and @DirectXMan12 lgtm'ed.

@sttts
Copy link
Contributor Author

sttts commented Apr 29, 2019

/assign @deads2k @lavalamp

@deads2k
Copy link
Contributor

deads2k commented Apr 29, 2019

Glad to see this moving forward.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, DirectXMan12, 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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2019
@k8s-ci-robot k8s-ci-robot merged commit 3ed015a into kubernetes:master Apr 29, 2019
@sttts sttts deleted the sttts-structural-schema branch April 30, 2019 08:08
// restrict the embedded object. Both ObjectMeta and TypeMeta
// are validated automatically. x-kubernetes-preserve-unknown-fields
// must be true.
XEmbeddedResource bool
Copy link
Contributor

@DirectXMan12 DirectXMan12 May 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurs to me at this point: why is this not a "format" value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format has local influence on the type it is defined in (are there exceptions?). XEmbeddedResource causes further behaviour changes which are not local (metadata is checked and pruned; apiVersion, kind is required). Also I think this is a very kubernetes specific concept. Using format for that doesn't feel right IMO, but is rather a cosmetical detail.

@lavalamp
Copy link
Member

lavalamp commented May 1, 2019

I strongly approve of the concept and don't have time to nitpick any details, so LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants