1
0
mirror of https://github.com/rancher/steve.git synced 2025-04-28 03:10:32 +00:00

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

Co-authored-by: Alejandro Ruiz <alejandro.ruiz@suse.com>
This commit is contained in:
Tom Lebreux 2025-04-04 12:45:12 -04:00 committed by GitHub
parent 54d4bc91ec
commit c36f949dc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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