1
0
Fork 0
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:
Steven Kang 2025-07-24 13:11:13 +12:00 committed by GitHub
parent bba3751268
commit bdb2e2f417
12 changed files with 417 additions and 25 deletions

View file

@ -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)
}