Skip to content

Commit

Permalink
Merge pull request #54 from vareti/qps-cli-flag
Browse files Browse the repository at this point in the history
make qps and burst values configurable
  • Loading branch information
k8s-ci-robot committed Jan 21, 2020
2 parents ece39bd + de8c73d commit 221b6ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/migrator/app/migrator.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app

import (
"flag"
"fmt"
"log"
"net/http"
Expand All @@ -12,6 +11,7 @@ import (
"github.com/kubernetes-sigs/kube-storage-version-migrator/pkg/version"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/rest"
Expand All @@ -24,6 +24,8 @@ const (

var (
kubeconfigPath = flag.String("kubeconfig", "", "absolute path to the kubeconfig file specifying the apiserver instance. If unspecified, fallback to in-cluster configuration")
kubeAPIQPS = flag.Float32("kube-api-qps", rest.DefaultQPS, "QPS to use while talking with kubernetes apiserver.")
kubeAPIBurst = flag.Int("kube-api-burst", rest.DefaultBurst, "Burst to use while talking with kubernetes apiserver.")
)

func NewMigratorCommand() *cobra.Command {
Expand Down Expand Up @@ -56,6 +58,8 @@ func Run(stopCh <-chan struct{}) error {
return err
}
}
config.QPS = *kubeAPIQPS
config.Burst = *kubeAPIBurst
config.UserAgent = migratorUserAgent + "/" + version.VERSION
dynamic, err := dynamic.NewForConfig(config)
if err != nil {
Expand Down

0 comments on commit 221b6ef

Please sign in to comment.