From 77f4ef877e47c891aa52e62309e90ceaa40c5983 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Thu, 6 Aug 2020 13:15:47 +0530 Subject: [PATCH] Replace `csiTimeout` to `timeout` param for resizer At present the resizer has CSI call timeout value taken as arg in form of `--csiTimeout` , however all other sidecars have this parameter as `--timeout`. This patch replaces `csiTimeout` to `timeout` value NOTE: This is a breaking change, so we need a new release Signed-off-by: Humble Chirammal --- README.md | 2 +- cmd/csi-resizer/main.go | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e709900b9..b0fed3bdf 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Note that the external-resizer does not scale with more replicas. Only one exter * `--leader-election-namespace`: Namespace where the leader election resource lives. Defaults to the pod namespace if not set. -* `--csiTimeout `: Timeout of all calls to CSI driver. It should be set to value that accommodates majority of `ControllerExpandVolume` calls. 15 seconds is used by default. +* `--timeout `: Timeout of all calls to CSI driver. It should be set to value that accommodates majority of `ControllerExpandVolume` calls. 10 seconds is used by default. * `--retry-interval-start`: The starting value of the exponential backoff for failures. 1 second is used by default. diff --git a/cmd/csi-resizer/main.go b/cmd/csi-resizer/main.go index 0d7740229..fad34c5f2 100644 --- a/cmd/csi-resizer/main.go +++ b/cmd/csi-resizer/main.go @@ -20,11 +20,12 @@ import ( "context" "flag" "fmt" + "os" + "time" + "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "os" - "time" "k8s.io/client-go/util/workqueue" @@ -44,8 +45,9 @@ var ( resyncPeriod = flag.Duration("resync-period", time.Minute*10, "Resync period for cache") workers = flag.Int("workers", 10, "Concurrency to process multiple resize requests") - csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.") - csiTimeout = flag.Duration("csiTimeout", 15*time.Second, "Timeout for waiting for CSI driver socket.") + csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.") + timeout = flag.Duration("timeout", 10*time.Second, "Timeout for waiting for CSI driver socket.") + showVersion = flag.Bool("version", false, "Show version") retryIntervalStart = flag.Duration("retry-interval-start", time.Second, "Initial retry interval of failed volume resize. It exponentially increases with each failure, up to retry-interval-max.") @@ -99,7 +101,7 @@ func main() { csiResizer, err := resizer.NewResizer( *csiAddress, - *csiTimeout, + *timeout, kubeClient, informerFactory, *metricsAddress,