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

apiextensions: [alpha] opt-in CR pruning according to OpenAPI schema #64558

Closed
wants to merge 5 commits into from

Conversation

sttts
Copy link
Contributor

@sttts sttts commented May 31, 2018

Wire in OpenAPI schema based pruning into

  • storage decoder
  • request deserializer (which is used for incoming request, but also conversion during patch and admission webhooks)

Follow-up of #63604, with pruning only.

Add CustomResource pruning as opt-in via spec.prune as alpha feature, available via the feature gate `CustomResourcePruning` (defaults to off). If enabled for a CustomResourceDefinition all fields not specified in the OpenAPI schema are dropped when received via a request, or read from etcd. A sub-object can be excluded from pruning by setting the OpenAPI x-kubernetes-no-prune extension to true.

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 31, 2018
@sttts sttts changed the title apiextensions: [alpha] add opt-in CR pruning according to OpenAPI schema apiextensions: [alpha] opt-in CR pruning according to OpenAPI schema Jun 2, 2018
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2018
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 4, 2018
@sttts sttts force-pushed the sttts-new-crd-pruning branch 3 times, most recently from dc63c26 to 73c7427 Compare June 4, 2018 12:16
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 4, 2018
@sttts
Copy link
Contributor Author

sttts commented Jun 4, 2018

/sig api-machinery
/area custom-resources
/kind feature

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. area/custom-resources kind/feature Categorizes issue or PR as related to a new feature. labels Jun 4, 2018
@sttts
Copy link
Contributor Author

sttts commented Jun 4, 2018

/retest

@sttts sttts force-pushed the sttts-new-crd-pruning branch 2 times, most recently from 5f14be6 to a0d8005 Compare June 5, 2018 13:05
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2018
@erictune
Copy link
Member

erictune commented Jul 9, 2018

Please ensure this supports having a subtree of the object that is not pruned.
E.g. this schema:

spec:
      a: int
      b: string
      c: raw message 

Will cause this object:

spec:
    a: 1
    b: "2"
    c: 
        thisPropertyDefinitelyNotMentionedInTheSchema: 1
        norThisOne: 
            foo: bar
    d: 4

will be pruned to this:

spec:
    a: 1
    b: "2"
    c: 
        thisPropertyDefinitelyNotMentionedInTheSchema: 1
        norThisOne: 
            foo: bar

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sttts
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers: deads2k, liggitt

If they are not already assigned, you can assign the PR to them by writing /assign @deads2k @liggitt in a comment when ready.

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

@sttts sttts force-pushed the sttts-new-crd-pruning branch 2 times, most recently from 0d2e8cf to e481f7c Compare August 20, 2018 15:59
@sttts sttts force-pushed the sttts-new-crd-pruning branch 3 times, most recently from ae70210 to eeddf2f Compare August 20, 2018 16:14
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Aug 20, 2018

@sttts: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-bazel-test 4655dc7 link /test pull-kubernetes-bazel-test
pull-kubernetes-integration 4655dc7 link /test pull-kubernetes-integration
pull-kubernetes-verify 4655dc7 link /test pull-kubernetes-verify
pull-kubernetes-e2e-gce-device-plugin-gpu 4655dc7 link /test pull-kubernetes-e2e-gce-device-plugin-gpu

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2018
@k8s-ci-robot
Copy link
Contributor

@sttts: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spiffxp
Copy link
Member

spiffxp commented Oct 16, 2018

ping, needs rebase

@spiffxp
Copy link
Member

spiffxp commented Oct 16, 2018

/milestone v1.13
I'm adding this to the v1.13 milestone since it relates to kubernetes/enhancements#575 which is currently planned for v1.13

@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Oct 16, 2018
@shubheksha
Copy link
Contributor

@nikopen, can we remove the milestone from this PR as kubernetes/enhancements#575 isn't tracked anymore.

@sttts sttts removed this from the v1.13 milestone Nov 5, 2018
@mrshelly
Copy link

mrshelly commented Jan 24, 2019 via email

@liggitt liggitt added this to the v1.15 milestone Apr 2, 2019
@liggitt liggitt added this to Required for GA, in progress in Custom Resource Definitions Apr 18, 2019
@liggitt
Copy link
Member

liggitt commented May 24, 2019

closing in favor of #77333

@liggitt liggitt closed this May 24, 2019
@liggitt liggitt moved this from Required for GA, in progress to Complete in Custom Resource Definitions May 24, 2019
@liggitt liggitt removed this from Complete in Custom Resource Definitions May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/custom-resources cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants