Skip to content

Commit

Permalink
Don't ratelimit the client
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Aug 29, 2020
1 parent 2ec8aea commit 9588ca3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/agent/pkg/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"time"

"github.com/rancher/fleet/modules/agent/pkg/controllers/cluster"

"github.com/rancher/fleet/modules/agent/pkg/controllers/bundledeployment"
"github.com/rancher/fleet/modules/agent/pkg/controllers/cluster"
"github.com/rancher/fleet/modules/agent/pkg/controllers/secret"
"github.com/rancher/fleet/modules/agent/pkg/deployer"
"github.com/rancher/fleet/modules/agent/pkg/trigger"
Expand All @@ -22,6 +21,7 @@ import (
"github.com/rancher/wrangler/pkg/generated/controllers/rbac"
rbaccontrollers "github.com/rancher/wrangler/pkg/generated/controllers/rbac/v1"
"github.com/rancher/wrangler/pkg/leader"
"github.com/rancher/wrangler/pkg/ratelimit"
"github.com/rancher/wrangler/pkg/start"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/api/meta"
Expand Down Expand Up @@ -175,6 +175,9 @@ func newContext(fleetNamespace, agentNamespace, clusterNamespace, clusterName st
return nil, err
}

client = rest.CopyConfig(client)
client.RateLimiter = ratelimit.None

k8s, err := kubernetes.NewForConfig(client)
if err != nil {
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions pkg/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/rancher/wrangler/pkg/generated/controllers/rbac"
rbaccontrollers "github.com/rancher/wrangler/pkg/generated/controllers/rbac/v1"
"github.com/rancher/wrangler/pkg/leader"
"github.com/rancher/wrangler/pkg/ratelimit"
"github.com/rancher/wrangler/pkg/start"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -217,6 +218,7 @@ func newContext(cfg clientcmd.ClientConfig) (*appContext, error) {
if err != nil {
return nil, err
}
client.RateLimiter = ratelimit.None

core, err := core.NewFactoryFromConfig(client)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/helmdeployer/impersonate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package helmdeployer
import (
"fmt"

"github.com/rancher/wrangler/pkg/ratelimit"
apierror "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/rest"
Expand Down Expand Up @@ -39,6 +40,7 @@ func newImpersonatingGetter(namespace, name string, getter genericclioptions.RES
if err != nil {
return nil, err
}
restConfig.RateLimiter = ratelimit.None

return &impersonatingGetter{
RESTClientGetter: getter,
Expand Down

0 comments on commit 9588ca3

Please sign in to comment.