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

Add support for submitting/receiving CRD objects as yaml #58260

Merged
merged 3 commits into from Jan 16, 2018

Conversation

@liggitt
Member

liggitt commented Jan 14, 2018

Fixes #37455

Custom resources can now be submitted to and received from the API server in application/yaml format, consistent with other API resources.

liggitt added some commits Jan 16, 2018

@k8s-ci-robot k8s-ci-robot added size/L and removed size/M labels Jan 16, 2018

@liggitt liggitt changed the title from WIP - Add support for submitting/receiving CRD objects as yaml to Add support for submitting/receiving CRD objects as yaml Jan 16, 2018

@liggitt

This comment has been minimized.

Member

liggitt commented Jan 16, 2018

Updated with integration test:

  • ensures create/update/delete/get/list accept/return YAML
  • ensures patch/watch reject YAML
  • ensures error cases return v1 Status objects
@liggitt

This comment has been minimized.

Member

liggitt commented Jan 16, 2018

// TODO: handle this in negotiation
contentType := req.Header.Get("Content-Type")
// Remove "; charset=" if included in header.
if idx := strings.Index(contentType, ";"); idx > 0 {

This comment has been minimized.

@sttts

sttts Jan 16, 2018

Contributor

nit: >= 0

This comment has been minimized.

@liggitt

liggitt Jan 16, 2018

Member

Preexisting, and I don't think so… leading ; isn't a valid mime type attribute

return func(w http.ResponseWriter, req *http.Request) {
// Do this first, otherwise name extraction can fail for unrecognized content types
// TODO: handle this in negotiation

This comment has been minimized.

@sttts

sttts Jan 16, 2018

Contributor

what's meant with the TODO? (I know it pre-existed)

This comment has been minimized.

@liggitt

liggitt Jan 16, 2018

Member

It means to switch this to follow a similar flow with the negotiating serializer, that's just not built for dealing with patch mime types as-is

This comment has been minimized.

@sttts

sttts Jan 16, 2018

Contributor

was reading "in negation". negotiation makes more sense actually.

@sttts

This comment has been minimized.

Contributor

sttts commented Jan 16, 2018

Looks good.

@deads2k

This comment has been minimized.

Contributor

deads2k commented Jan 16, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jan 16, 2018

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Jan 16, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, liggitt

Associated issue: #37455

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Jan 16, 2018

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Jan 16, 2018

@liggitt: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-unit 59c305b link /test pull-kubernetes-unit

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-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Jan 16, 2018

Automatic merge from submit-queue (batch tested with PRs 58260, 58326). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit a7c65d2 into kubernetes:master Jan 16, 2018

11 of 13 checks passed

pull-kubernetes-unit Job failed.
Details
Submit Queue Required Github CI test is not green: pull-kubernetes-unit
Details
cla/linuxfoundation liggitt authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke-gci Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

@timothysc timothysc removed their assignment Jan 16, 2018

@liggitt liggitt deleted the liggitt:crd-yaml branch Jan 17, 2018

@jennybuckley

This comment has been minimized.

Contributor

jennybuckley commented Jan 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment