mirror of
https://github.com/rancher/steve.git
synced 2025-04-27 19:05:09 +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:
parent
54d4bc91ec
commit
c36f949dc6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user