Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Exapose the rateLimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
cwdsuzhou committed Jun 30, 2020
1 parent 2d648e1 commit a553fa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/commands/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ func runRootCommandWithProviderAndClient(ctx context.Context, pInit provider.Ini
SecretInformer: secretInformer,
ConfigMapInformer: configMapInformer,
ServiceInformer: serviceInformer,
RateLimiter: c.RateLimiter,
})
if err != nil {
return errors.Wrap(err, "error setting up pod controller")
Expand Down
4 changes: 4 additions & 0 deletions opts/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/mitchellh/go-homedir"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/util/workqueue"
)

// Defaults for root command options
Expand Down Expand Up @@ -93,6 +94,8 @@ type Opts struct {
KubeAPIQPS int32
// KubeAPIBurst is the burst to allow while talking with kubernetes apiserver
KubeAPIBurst int32
// RateLimiter defines the rate limit of work queue
RateLimiter workqueue.RateLimiter

Version string
}
Expand Down Expand Up @@ -147,6 +150,7 @@ func setDefaults(o *Opts) {
o.KubeClusterDomain = DefaultKubeClusterDomain
o.StreamIdleTimeout = DefaultStreamIdleTimeout
o.StreamCreationTimeout = DefaultStreamCreationTimeout
o.RateLimiter = workqueue.DefaultControllerRateLimiter()
}

func getEnv(key, defaultValue string) string {
Expand Down

0 comments on commit a553fa2

Please sign in to comment.