2021-12-01 13:18:57 +13:00
|
|
|
package kubernetes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
2025-07-24 13:11:13 +12:00
|
|
|
"strings"
|
2021-12-01 13:18:57 +13:00
|
|
|
)
|
|
|
|
|
2025-07-24 13:11:13 +12:00
|
|
|
func (transport *baseTransport) proxyPodsRequest(request *http.Request, namespace string) (*http.Response, error) {
|
2023-07-10 23:26:54 -03:00
|
|
|
if request.Method == http.MethodDelete {
|
2021-12-01 13:18:57 +13:00
|
|
|
transport.refreshRegistry(request, namespace)
|
|
|
|
}
|
2023-07-10 23:26:54 -03:00
|
|
|
|
2025-07-24 13:11:13 +12:00
|
|
|
if request.Method == http.MethodPost && strings.Contains(request.URL.Path, "/exec") {
|
|
|
|
if err := transport.addTokenForExec(request); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
2023-07-10 23:26:54 -03:00
|
|
|
return transport.executeKubernetesRequest(request)
|
2022-01-17 07:53:32 +02:00
|
|
|
}
|