From 1d93f398399f6ab5b9feaa6fb400fb61086997da Mon Sep 17 00:00:00 2001 From: Prithvi Ramesh Date: Thu, 23 Jul 2020 03:18:02 -0700 Subject: [PATCH] Add flag to configure the registration socket path --- cmd/csi-node-driver-registrar/main.go | 1 + cmd/csi-node-driver-registrar/node_register.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/csi-node-driver-registrar/main.go b/cmd/csi-node-driver-registrar/main.go index 7c8aa1cf..b3e17850 100644 --- a/cmd/csi-node-driver-registrar/main.go +++ b/cmd/csi-node-driver-registrar/main.go @@ -46,6 +46,7 @@ const ( var ( connectionTimeout = flag.Duration("connection-timeout", 0, "The --connection-timeout flag is deprecated") csiAddress = flag.String("csi-address", "/run/csi/socket", "Path of the CSI driver socket that the node-driver-registrar will connect to.") + pluginRegistrationPath = flag.String("plugin-registration-path", "/registration", "Path to Kubernetes plugin registration directory.") kubeletRegistrationPath = flag.String("kubelet-registration-path", "", "Path of the CSI driver socket on the Kubernetes host machine.") showVersion = flag.Bool("version", false, "Show version.") version = "unknown" diff --git a/cmd/csi-node-driver-registrar/node_register.go b/cmd/csi-node-driver-registrar/node_register.go index 8656b7b3..75ce1fd0 100644 --- a/cmd/csi-node-driver-registrar/node_register.go +++ b/cmd/csi-node-driver-registrar/node_register.go @@ -75,7 +75,7 @@ func nodeRegister( } func buildSocketPath(csiDriverName string) string { - return fmt.Sprintf("/registration/%s-reg.sock", csiDriverName) + return fmt.Sprintf("%s/%s-reg.sock", *pluginRegistrationPath, csiDriverName) } func removeRegSocket(csiDriverName string) {