Skip to content

Commit 37d370a

Browse files
committed
move backoff duration to flag
1 parent 662bd90 commit 37d370a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cmd/gce-pd-csi-driver/main.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ var (
4242
httpEndpoint = flag.String("http-endpoint", "", "The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled.")
4343
metricsPath = flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.")
4444

45-
extraVolumeLabelsStr = flag.String("extra-labels", "", "Extra labels to attach to each PD created. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'. See https://cloud.google.com/compute/docs/labeling-resources for details")
45+
errorBackoffInitialDurationMs = flag.Int("backoff-initial-duration-ms", 200 , "The amount of ms for the initial duration of the backoff condition. Default is 200.")
46+
extraVolumeLabelsStr = flag.String("extra-labels", "", "Extra labels to attach to each PD created. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'. See https://cloud.google.com/compute/docs/labeling-resources for details")
4647

4748
attachDiskBackoffDuration = flag.Duration("attach-disk-backoff-duration", 5*time.Second, "Duration for attachDisk backoff")
4849
attachDiskBackoffFactor = flag.Float64("attach-disk-backoff-factor", 0.0, "Factor for attachDisk backoff")
@@ -57,8 +58,6 @@ var (
5758

5859
maxprocs = flag.Int("maxprocs", 1, "GOMAXPROCS override")
5960

60-
errorBackoffInitialDuration = 200 * time.Millisecond
61-
6261
version string
6362
)
6463

@@ -124,7 +123,7 @@ func handle() {
124123
if err != nil {
125124
klog.Fatalf("Failed to get cloud provider: %v", err)
126125
}
127-
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, errorBackoffInitialDuration)
126+
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, time.Duration(*errorBackoffInitialDurationMs) * time.Millisecond)
128127
} else if *cloudConfigFilePath != "" {
129128
klog.Warningf("controller service is disabled but cloud config given - it has no effect")
130129
}

0 commit comments

Comments
 (0)