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

Fix publishing x-kubernetes-preserve-unknown-fields working with kubectl #79636

Merged

Conversation

@liggitt
Copy link
Member

commented Jul 2, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
Fixes published openapi for CRDs with x-kubernetes-preserve-unknown-fields so that kubectl allows sending unknown fields, by dropping items/properties (including apiVersion/kind/metadata properties) from the published v2 schema.

Extracted from #79604 for separate merge and picking to 1.15

Does this PR introduce a user-facing change?:

Fixes a bug in openapi published for custom resources using x-kubernetes-preserve-unknown-fields extensions, so that kubectl will allow sending unknown fields for that portion of the object.

/sig api-machinery
/priority important-soon
/cc @sttts @roycaihw

@sttts

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

/lgtm
/hold

A kubectl test would be nice, if feasible. Follow-up is fine. Unhold as you like.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jul 3, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2019

[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

@liggitt

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2019

/hold cancel

@@ -337,18 +405,23 @@ var _ = SIGDescribe("CustomResourcePublishOpenAPI", func() {
})

func setupCRD(f *framework.Framework, schema []byte, groupSuffix string, versions ...string) (*crd.TestCrd, error) {
expect := schema

This comment has been minimized.

Copy link
@sttts

sttts Jul 3, 2019

Contributor

this expect argument is really odd. Our tests are too entangled.

@sttts

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jul 3, 2019

@k8s-ci-robot k8s-ci-robot merged commit 8765ed3 into kubernetes:master Jul 3, 2019

23 checks passed

cla/linuxfoundation liggitt authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

@liggitt liggitt deleted the liggitt:crd-preserve-unknown-openapi branch Jul 3, 2019

@yliaog

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

/cc @roycaihw

@liggitt liggitt moved this from Required for GA, in progress to Complete in Custom Resource Definitions Jul 9, 2019

k8s-ci-robot added a commit that referenced this pull request Jul 10, 2019

Merge pull request #79638 from liggitt/automated-cherry-pick-of-#7963…
…6-upstream-release-1.15

Automated cherry pick of #79636: Fix publishing x-kubernetes-preserve-unknown-fields working
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.