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

Skip publishing OpenAPI for nonstructural schemas #82653

Merged
merged 2 commits into from
Sep 12, 2019

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Sep 12, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:

  • Restores compatibility with 1.15 CRDs by not publishing openapi non-structural schemas
  • Restores compatibility with 1.14 CRDs by not publishing openapi for structural schemas whose CRDs set spec.preserveUnknownFields=true

Which issue(s) this PR fixes:
Fixes #82651

Does this PR introduce a user-facing change?:

Restores compatibility with <=1.15.x custom resources by not publishing OpenAPI for non-structural custom resource definitions

/assign @roycaihw @sttts
/cc @aanm
/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 12, 2019
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Sep 12, 2019
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 12, 2019
@liggitt
Copy link
Member Author

liggitt commented Sep 12, 2019

/milestone v1.16
/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 12, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.16 milestone Sep 12, 2019
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 12, 2019
@liggitt
Copy link
Member Author

liggitt commented Sep 12, 2019

/retest

@liggitt
Copy link
Member Author

liggitt commented Sep 12, 2019

verified only {"type":"object"} definition is now published for:

  • non-structural schemas
  • structural schemas in CRDs with spec.preserveUnknownFields=true

Copy link
Contributor

@aanm aanm left a comment

Choose a reason for hiding this comment

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

I've test it out kube-apiserver rc.1 with this patch and it works again. Thanks @liggitt ! 🚤

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

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 area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Sep 12, 2019
@liggitt liggitt changed the title Skip publishing nonstructural schemas Skip publishing OpenAPI for nonstructural schemas Sep 12, 2019
@liggitt liggitt added this to Bugs/Cleanup/Tests in Custom Resource Definitions Sep 12, 2019
@liggitt
Copy link
Member Author

liggitt commented Sep 12, 2019

/retest

@sttts
Copy link
Contributor

sttts commented Sep 12, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 12, 2019
@liggitt
Copy link
Member Author

liggitt commented Sep 12, 2019

grrr

diff -Naupr -x _output /home/prow/go/src/k8s.io/kubernetes/test/integration/master/BUILD /tmp/verify-bazel.PIXBfZ/go/src/k8s.io/kubernetes/test/integration/master/BUILD
--- /home/prow/go/src/k8s.io/kubernetes/test/integration/master/BUILD	2019-09-12 18:29:28.613188619 +0000
+++ /tmp/verify-bazel.PIXBfZ/go/src/k8s.io/kubernetes/test/integration/master/BUILD	2019-09-12 18:29:54.776436873 +0000
@@ -70,6 +70,7 @@ go_test(
         "//vendor/github.com/evanphx/json-patch:go_default_library",
         "//vendor/github.com/go-openapi/spec:go_default_library",
         "//vendor/github.com/stretchr/testify/require:go_default_library",
+        "//vendor/k8s.io/utils/pointer:go_default_library",
         "//vendor/sigs.k8s.io/yaml:go_default_library",
     ] + select({
         "@io_bazel_rules_go//go/platform:android": [

Run ./hack/update-bazel.sh

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

New changes are detected. LGTM label has been removed.

@liggitt liggitt added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 12, 2019
@liggitt
Copy link
Member Author

liggitt commented Sep 12, 2019

bazel regenerated, retagged

@k8s-ci-robot k8s-ci-robot merged commit 21db9c2 into kubernetes:master Sep 12, 2019
@k8s-ci-robot k8s-ci-robot modified the milestones: v1.16, v1.17 Sep 12, 2019
@liggitt liggitt moved this from Bugs/Cleanup/Tests to Complete in Custom Resource Definitions Sep 12, 2019
@liggitt liggitt deleted the skip-publish-nonstructural branch September 13, 2019 01:56
k8s-ci-robot added a commit that referenced this pull request Sep 13, 2019
…3-upstream-release-1.16

Automated cherry pick of #82653: Skip publishing OpenAPI for nonstructural schemas
@roycaihw
Copy link
Member

LGTM

@roycaihw
Copy link
Member

/area custom-resources

@alexellis
Copy link

@liggitt not sure if you mind the question here vs. another forum. Could this patch be related to a recent regression in the OpenFaaS CRD when taking K8s 1.17.5 and 1.18? openfaas/faas-netes#630 (comment)

@liggitt
Copy link
Member Author

liggitt commented May 7, 2020

no, this is not related. what you are seeing might be related to #85127 (comment)

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. area/custom-resources area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. 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. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Development

Successfully merging this pull request may close these issues.

1.16 publishes openapi for non-structural schemas
6 participants