mirror of
https://github.com/portainer/portainer.git
synced 2025-07-28 01:39:39 +02:00
19 lines
493 B
Go
19 lines
493 B
Go
package kubernetes
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
)
|
|
|
|
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)
|
|
}
|