mirror of
https://github.com/portainer/portainer.git
synced 2025-07-30 18:59:41 +02:00
fix(transport): portainer generated kubeconfig causes kubectl exec fail [R8S-430] (#929)
This commit is contained in:
parent
bba3751268
commit
bdb2e2f417
12 changed files with 417 additions and 25 deletions
|
@ -2,12 +2,18 @@ package kubernetes
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (transport *baseTransport) proxyPodsRequest(request *http.Request, namespace, requestPath string) (*http.Response, error) {
|
||||
func (transport *baseTransport) proxyPodsRequest(request *http.Request, namespace string) (*http.Response, error) {
|
||||
if request.Method == http.MethodDelete {
|
||||
transport.refreshRegistry(request, namespace)
|
||||
}
|
||||
|
||||
if request.Method == http.MethodPost && strings.Contains(request.URL.Path, "/exec") {
|
||||
if err := transport.addTokenForExec(request); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return transport.executeKubernetesRequest(request)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue