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

Make the API server deal with HEAD requests via the service proxy #7950

Merged
merged 1 commit into from May 8, 2015

Conversation

satnam6502
Copy link
Contributor

This addresses issue #7517 and I tested this out on the Elasticsearch and Kibana logging setup. I observed the new Kibana 4 (running with a back-end server) correctly issuing a HEAD request to Elasticsearch.

NFO: 2015-05-08T06:27:51Z
  Adding connection to https://104.197.16.133/api/v1beta3/proxy/namespaces/default/services/kibana-logging/elasticsearch


index.js?_b=6004:45725 bootstrap
index.js?_b=6004:45725 es check
index.js?_b=6004:45725 config init
index.js?_b=6004:45721 complete in 135.86ms
index.js?_b=6004:45725 checkEsVersion
index.js?_b=6004:45721 complete in 127.33ms
index.js?_b=6004:45725 kibana index check
index.js?_b=6004:17838 HEAD https://104.197.16.133/api/v1beta3/proxy/namespaces/default/services/kibana-logging/elasticsearch/.kibana 404 (Not Found)(anonymous function) @ index.js?_b=6004:17838sendReq @ index.js?_b=6004:17632$get.serverRequest @ index.js?_b=6004:17352deferred.promise.then.wrappedCallback @ index.js?_b=6004:20888deferred.promise.then.wrappedCallback @ index.js?_b=6004:20888(anonymous function) @ index.js?_b=6004:20974$get.Scope.$eval @ index.js?_b=6004:22017$get.Scope.$digest @ index.js?_b=6004:21829(anonymous function) @ index.js?_b=6004:22055completeOutstandingRequest @ index.js?_b=6004:13617(anonymous function) @ index.js?_b=6004:13931
index.js?_b=6004:45721 complete in 66.83ms
index.js?_b=6004:45725 kibana index creation
index.js?_b=6004:45721 complete in 200.15ms
index.js?_b=6004:45721 complete in 532.59ms
index.js?_b=6004:45721 complete in 825.34ms
index.js?_b=6004:19332 Error: Please specify a default index pattern
    at index.js?_b=6004:44810
    at deferred.promise.then.wrappedCallback (index.js?_b=6004:20888)
    at index.js?_b=6004:20974
    at Scope.$get.Scope.$eval (index.js?_b=6004:22017)
    at Scope.$get.Scope.$digest (index.js?_b=6004:21829)
    at Scope.$get.Scope.$apply (index.js?_b=6004:22121)
    at done (index.js?_b=6004:17656)
    at completeRequest (index.js?_b=6004:17870)
    at XMLHttpRequest.xhr.onreadystatechange (index.js?_b=6004:17809)(anonymous function) @ index.js?_b=6004:19332$get @ index.js?_b=6004:16604deferred.promise.then.wrappedCallback @ index.js?_b=6004:20891(anonymous function) @ index.js?_b=6004:20974$get.Scope.$eval @ index.js?_b=6004:22017$get.Scope.$digest @ index.js?_b=6004:21829$get.Scope.$apply @ index.js?_b=6004:22121done @ index.js?_b=6004:17656completeRequest @ index.js?_b=6004:17870xhr.onreadystatechange @ index.js?_b=6004:17809
index.js?_b=6004:45725 loading default index pattern
index.js?_b=6004:45423 Root Search Source: index pattern set to null
index.js?_b=6004:45721 complete in 0.82ms
index.js?_b=6004:45423 config change: defaultIndex: undefined -> logstash-*
index.js?_b=6004:45725 loading default index pattern
index.js?_b=6004:45423 Root Search Source: index pattern set to logstash-*
index.js?_b=6004:45721 complete in 86.99ms
index.js?_b=6004:45725 loading default index pattern
index.js?_b=6004:45423 Root Search Source: index pattern set to logstash-*
index.js?_b=6004:45721 complete in 1.04ms
index.js?_b=6004:45725 loading default index pattern

@lavalamp @brendandburns @ArtfulCoder

@satnam6502 satnam6502 changed the title Make the API server deal with HEAD requests Make the API server deal with HEAD requests via the service proxy May 8, 2015
@@ -514,6 +514,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
addProxyRoute(ws, "PUT", a.prefix, action.Path, proxyHandler, kind, resource, action.Params)
addProxyRoute(ws, "POST", a.prefix, action.Path, proxyHandler, kind, resource, action.Params)
addProxyRoute(ws, "DELETE", a.prefix, action.Path, proxyHandler, kind, resource, action.Params)
addProxyRoute(ws, "HEAD", a.prefix, action.Path, proxyHandler, kind, resource, action.Params)
Copy link
Member

Choose a reason for hiding this comment

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

Awesome-- how about adding TRACE while you're here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@lavalamp
Copy link
Member

lavalamp commented May 8, 2015

LGTM, thanks!

@lavalamp lavalamp added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 8, 2015
lavalamp added a commit that referenced this pull request May 8, 2015
Make the API server deal with HEAD requests via the service proxy
@lavalamp lavalamp merged commit b02149d into kubernetes:master May 8, 2015
@roberthbailey
Copy link
Contributor

Jenkins went red running a build where this was the only PR merged.

@roberthbailey
Copy link
Contributor

It looks like the current build is at least running tests though.

@ArtfulCoder
Copy link
Contributor

one of the test runs that failed with this merge failed because of a setup issue..

http://kubekins.dls.corp.google.com/job/kubernetes-e2e-gce/5783/console

@lavalamp
Copy link
Member

lavalamp commented May 8, 2015

@roberthbailey it seems extremely unlikely to me that this actually is the cause.

@roberthbailey
Copy link
Contributor

I agree. I hadn't dug into the cause of the failure prior to commenting here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants