diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json index 835ee96ed50..77891e1c05a 100644 --- a/api/swagger-spec/v1.json +++ b/api/swagger-spec/v1.json @@ -5850,7 +5850,24 @@ "method": "GET", "summary": "connect GET requests to exec of Pod", "nickname": "connectGetPodExec", - "parameters": [], + "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": [ "*/*" ], @@ -5920,7 +5937,24 @@ "method": "GET", "summary": "connect GET requests to portforward of Pod", "nickname": "connectGetPodPortforward", - "parameters": [], + "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": [ "*/*" ], @@ -5939,7 +5973,24 @@ "method": "GET", "summary": "connect GET requests to proxy of Pod", "nickname": "connectGetPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5952,7 +6003,24 @@ "method": "POST", "summary": "connect POST requests to proxy of Pod", "nickname": "connectPostPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5965,7 +6033,24 @@ "method": "PUT", "summary": "connect PUT requests to proxy of Pod", "nickname": "connectPutPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5978,7 +6063,24 @@ "method": "DELETE", "summary": "connect DELETE requests to proxy of Pod", "nickname": "connectDeletePodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5991,7 +6093,24 @@ "method": "HEAD", "summary": "connect HEAD requests to proxy of Pod", "nickname": "connectHeadPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6004,7 +6123,24 @@ "method": "OPTIONS", "summary": "connect OPTIONS requests to proxy of Pod", "nickname": "connectOptionsPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6023,7 +6159,32 @@ "method": "GET", "summary": "connect GET requests to proxy of Pod", "nickname": "connectGetPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6036,7 +6197,32 @@ "method": "POST", "summary": "connect POST requests to proxy of Pod", "nickname": "connectPostPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6049,7 +6235,32 @@ "method": "PUT", "summary": "connect PUT requests to proxy of Pod", "nickname": "connectPutPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6062,7 +6273,32 @@ "method": "DELETE", "summary": "connect DELETE requests to proxy of Pod", "nickname": "connectDeletePodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6075,7 +6311,32 @@ "method": "HEAD", "summary": "connect HEAD requests to proxy of Pod", "nickname": "connectHeadPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6088,7 +6349,32 @@ "method": "OPTIONS", "summary": "connect OPTIONS requests to proxy of Pod", "nickname": "connectOptionsPodProxy", - "parameters": [], + "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": [ "*/*" ], diff --git a/api/swagger-spec/v1beta3.json b/api/swagger-spec/v1beta3.json index 011a8050c63..0c37384efdb 100644 --- a/api/swagger-spec/v1beta3.json +++ b/api/swagger-spec/v1beta3.json @@ -5850,7 +5850,24 @@ "method": "GET", "summary": "connect GET requests to exec of Pod", "nickname": "connectGetPodExec", - "parameters": [], + "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": [ "*/*" ], @@ -5920,7 +5937,24 @@ "method": "GET", "summary": "connect GET requests to portforward of Pod", "nickname": "connectGetPodPortforward", - "parameters": [], + "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": [ "*/*" ], @@ -5939,7 +5973,24 @@ "method": "GET", "summary": "connect GET requests to proxy of Pod", "nickname": "connectGetPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5952,7 +6003,24 @@ "method": "POST", "summary": "connect POST requests to proxy of Pod", "nickname": "connectPostPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5965,7 +6033,24 @@ "method": "PUT", "summary": "connect PUT requests to proxy of Pod", "nickname": "connectPutPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5978,7 +6063,24 @@ "method": "DELETE", "summary": "connect DELETE requests to proxy of Pod", "nickname": "connectDeletePodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -5991,7 +6093,24 @@ "method": "HEAD", "summary": "connect HEAD requests to proxy of Pod", "nickname": "connectHeadPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6004,7 +6123,24 @@ "method": "OPTIONS", "summary": "connect OPTIONS requests to proxy of Pod", "nickname": "connectOptionsPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6023,7 +6159,32 @@ "method": "GET", "summary": "connect GET requests to proxy of Pod", "nickname": "connectGetPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6036,7 +6197,32 @@ "method": "POST", "summary": "connect POST requests to proxy of Pod", "nickname": "connectPostPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6049,7 +6235,32 @@ "method": "PUT", "summary": "connect PUT requests to proxy of Pod", "nickname": "connectPutPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6062,7 +6273,32 @@ "method": "DELETE", "summary": "connect DELETE requests to proxy of Pod", "nickname": "connectDeletePodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6075,7 +6311,32 @@ "method": "HEAD", "summary": "connect HEAD requests to proxy of Pod", "nickname": "connectHeadPodProxy", - "parameters": [], + "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": [ "*/*" ], @@ -6088,7 +6349,32 @@ "method": "OPTIONS", "summary": "connect OPTIONS requests to proxy of Pod", "nickname": "connectOptionsPodProxy", - "parameters": [], + "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": [ "*/*" ], diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index 261b34da6da..5247180086f 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -278,7 +278,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath + "/{path:*}", proxyParams, namer}, isRedirector) actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath, nameParams, namer}, isRedirector) actions = appendIf(actions, action{"CONNECT", itemPath, nameParams, namer}, isConnecter) - actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", nameParams, namer}, isConnecter && connectSubpath) + actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", proxyParams, namer}, isConnecter && connectSubpath) } else { // v1beta3+ format with namespace in path @@ -316,7 +316,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath + "/{path:*}", proxyParams, namer}, isRedirector) actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath, nameParams, namer}, isRedirector) actions = appendIf(actions, action{"CONNECT", itemPath, nameParams, namer}, isConnecter) - actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", nameParams, namer}, isConnecter && connectSubpath) + actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", proxyParams, namer}, isConnecter && connectSubpath) // list or post across namespace. // TODO: more strongly type whether a resource allows these actions on "all namespaces" (bulk delete) @@ -556,6 +556,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag return err } } + addParams(route, action.Params) ws.Route(route) } default: