From 4ba1ad720741c5a96d5ae4fe747653911ca6716b Mon Sep 17 00:00:00 2001 From: Matthew Cary Date: Mon, 18 Jul 2022 13:05:31 -0700 Subject: [PATCH] Backport https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/pull/969 to release-1.3 Change-Id: I0cc0db7c5988fbdd555b2116402bcc81b60b1fc6 --- cmd/gce-pd-csi-driver/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index 18cdce59b..3e0afa2df 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -20,6 +20,7 @@ import ( "flag" "math/rand" "os" + "runtime" "time" "k8s.io/klog" @@ -40,7 +41,10 @@ var ( 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.") metricsPath = flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.") extraVolumeLabelsStr = flag.String("extra-labels", "", "Extra labels to attach to each PD created. It is a comma separated list of key value pairs like '=,='. See https://cloud.google.com/compute/docs/labeling-resources for details") - version string + + maxprocs = flag.Int("maxprocs", 1, "GOMAXPROCS override") + + version string ) const ( @@ -67,6 +71,9 @@ func main() { func handle() { var err error + runtime.GOMAXPROCS(*maxprocs) + klog.Infof("Sys info: NumCPU: %v MAXPROC: %v", runtime.NumCPU(), runtime.GOMAXPROCS(0)) + if version == "" { klog.Fatalf("version must be set at compile time") }