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

WIP: Fixing CORS error in genericapiserver #27386

Closed
wants to merge 1 commit into from

Conversation

nikhiljindal
Copy link
Contributor

@nikhiljindal nikhiljindal commented Jun 14, 2016

Ref #24086


This change is Reviewable

@nikhiljindal
Copy link
Contributor Author

I think I have a fix but I cant get the test to pass, which obviously means that my fix is not correct.
Am still debugging, but wanted to put this out so that maybe someone else spots the problem.
cc @pendoragon @lavalamp

When I run the test, I see that the CORS handler is registered. But it is not called when I send the request.
I get a 405 method not allowed response from go-restful when I call OPTIONS on /apis. This means the ServerMux handler is being called before my CORS handler, but I cant figure out why.

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-label-needed labels Jun 14, 2016
@nikhiljindal nikhiljindal added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed release-note-label-needed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 14, 2016
@k8s-bot
Copy link

k8s-bot commented Jun 14, 2016

GCE e2e build/test passed for commit 27c133b.

@k8s-github-robot k8s-github-robot added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. retest-not-required-docs-only and removed retest-not-required-docs-only labels Jul 28, 2016
@apelisse apelisse removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Aug 11, 2016
@k8s-github-robot
Copy link

@nikhiljindal PR needs rebase

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 17, 2016
@smarterclayton
Copy link
Contributor

Since this was listed as a regression, do we need to commit to this for 1.4?

@smarterclayton smarterclayton added this to the v1.4 milestone Aug 19, 2016
@jessfraz jessfraz modified the milestone: v1.4 Oct 6, 2016
@k8s-github-robot
Copy link

This PR hasn't been active in 90 days. Closing this PR. Please reopen if you would like to work towards merging this change, if/when the PR is ready for the next round of review.

cc @nikhiljindal @smarterclayton

You can add 'keep-open' label to prevent this from happening again, or add a comment to keep it open another 90 days

master, etcdserver, _, _ := newMaster(t)
defer etcdserver.Terminate(t)

server := httptest.NewServer(master.HandlerContainer.ServeMux)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be server := httptest.NewServer(master.Handler) or server := httptest.NewServer(master.InsecureHandler)

t.Fatalf("unexpected error: %v", err)
}

if resp.StatusCode != http.StatusOK {
Copy link
Contributor

Choose a reason for hiding this comment

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

In case of an OPTIONS request, we are expecting http.StatusNoContent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants