From 3dfa12627c9719a2d38595de027cd83531113fcd 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 | 4 +++- cmd/csi-resizer/main.go | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e709900b9..7461abfd1 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,9 @@ 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. +* `--csiTimeout `: ( Deprecated, use --timeout instead) 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. 15 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..6ba5dc9ad 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,10 @@ 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.") + csiTimeout = flag.Duration("csiTimeout", 15*time.Second, "( Deprecated, use --timeout instead) Timeout for waiting for CSI driver socket.") + timeout = flag.Duration("timeout", 15*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 +102,7 @@ func main() { csiResizer, err := resizer.NewResizer( *csiAddress, - *csiTimeout, + *timeout, kubeClient, informerFactory, *metricsAddress,