1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-19 01:45:13 +00:00

Fix "Unable to cancel request for *client.addQuery" warnings (#512)

This commit is contained in:
Alejandro Ruiz
2025-02-20 18:03:03 +01:00
committed by Kevin McDermott
parent 9aa70eada0
commit 6de55df701

View File

@@ -7,6 +7,7 @@ import (
"github.com/rancher/apiserver/pkg/types"
"github.com/rancher/steve/pkg/attributes"
utilnet "k8s.io/apimachinery/pkg/util/net"
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
@@ -30,6 +31,8 @@ type addQuery struct {
next http.RoundTripper
}
var _ utilnet.RoundTripperWrapper = (*addQuery)(nil)
func (a *addQuery) RoundTrip(req *http.Request) (*http.Response, error) {
q := req.URL.Query()
for k, v := range a.values {
@@ -40,6 +43,10 @@ func (a *addQuery) RoundTrip(req *http.Request) (*http.Response, error) {
return a.next.RoundTrip(req)
}
func (a *addQuery) WrappedRoundTripper() http.RoundTripper {
return a.next
}
func NewFactory(cfg *rest.Config, impersonate bool) (*Factory, error) {
clientCfg := rest.CopyConfig(cfg)
clientCfg.QPS = 10000