diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json index 39081e2b52d..0e0703dc1d1 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 5c43aef8c10..57c06b748c5 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": [ + "*/*" + ] } ] }, 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