From 83f84a9821a5360ea73215842e4a2f72172f6afc Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Wed, 17 Jun 2015 15:27:24 -0400 Subject: [PATCH 1/2] OPTIONS should be passed through the proxy --- pkg/apiserver/api_installer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index 9547deafbdd..fdefcac2626 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -547,6 +547,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag addProxyRoute(ws, "POST", a.prefix, action.Path, proxyHandler, kind, resource, subresource, hasSubresource, action.Params) addProxyRoute(ws, "DELETE", a.prefix, action.Path, proxyHandler, kind, resource, subresource, hasSubresource, action.Params) addProxyRoute(ws, "HEAD", a.prefix, action.Path, proxyHandler, kind, resource, subresource, hasSubresource, action.Params) + addProxyRoute(ws, "OPTIONS", a.prefix, action.Path, proxyHandler, kind, resource, subresource, hasSubresource, action.Params) case "CONNECT": for _, method := range connecter.ConnectMethods() { doc := "connect " + method + " requests to " + kind From e7aedf297f8875c791daee31a74b843bf1ef1c9c Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Fri, 19 Jun 2015 14:37:10 -0400 Subject: [PATCH 2/2] Update Swagger doc --- api/swagger-spec/v1.json | 188 ++++++++++++++++++++++++++++++++++ api/swagger-spec/v1beta3.json | 188 ++++++++++++++++++++++++++++++++++ 2 files changed, 376 insertions(+) diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json index 1398011cb3e..e8b2b8fe138 100644 --- a/api/swagger-spec/v1.json +++ b/api/swagger-spec/v1.json @@ -3365,6 +3365,36 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Node", + "nickname": "proxyOPTIONSNode", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Node", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "path:*", + "description": "path to the resource", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -3481,6 +3511,28 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Node", + "nickname": "proxyOPTIONSNode", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Node", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -5415,6 +5467,44 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Pod", + "nickname": "proxyOPTIONSPod", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Pod", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "path:*", + "description": "path to the resource", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -5571,6 +5661,36 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Pod", + "nickname": "proxyOPTIONSPod", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Pod", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -10445,6 +10565,44 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Service", + "nickname": "proxyOPTIONSService", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Service", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "path:*", + "description": "path to the resource", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -10601,6 +10759,36 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Service", + "nickname": "proxyOPTIONSService", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Service", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, diff --git a/api/swagger-spec/v1beta3.json b/api/swagger-spec/v1beta3.json index 54ef2117bbd..c3f32a0c726 100644 --- a/api/swagger-spec/v1beta3.json +++ b/api/swagger-spec/v1beta3.json @@ -3365,6 +3365,36 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Node", + "nickname": "proxyOPTIONSNode", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Node", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "path:*", + "description": "path to the resource", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -3481,6 +3511,28 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Node", + "nickname": "proxyOPTIONSNode", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Node", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -5415,6 +5467,44 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Pod", + "nickname": "proxyOPTIONSPod", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Pod", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "path:*", + "description": "path to the resource", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -5571,6 +5661,36 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Pod", + "nickname": "proxyOPTIONSPod", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Pod", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -10445,6 +10565,44 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Service", + "nickname": "proxyOPTIONSService", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Service", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "path:*", + "description": "path to the resource", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] }, @@ -10601,6 +10759,36 @@ "consumes": [ "*/*" ] + }, + { + "type": "string", + "method": "OPTIONS", + "summary": "proxy OPTIONS requests to Service", + "nickname": "proxyOPTIONSService", + "parameters": [ + { + "type": "string", + "paramType": "path", + "name": "namespaces", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the Service", + "required": true, + "allowMultiple": false + } + ], + "produces": [ + "*/*" + ], + "consumes": [ + "*/*" + ] } ] },