diff --git a/cmd/yandex-csi-driver/main.go b/cmd/yandex-csi-driver/main.go index 4a0bd52..7691f72 100644 --- a/cmd/yandex-csi-driver/main.go +++ b/cmd/yandex-csi-driver/main.go @@ -35,7 +35,7 @@ func main() { folderID = flag.String("folder-id", "", "Folder ID") driverName = flag.String("driver-name", driver.DefaultDriverName, "Name for the driver") address = flag.String("address", driver.DefaultAddress, "Address to serve on") - clusterName = flag.String("cluster-name", driver.DefaultClusterName, "Cluster name") + clusterUUID = flag.String("cluster-name", driver.DefaultClusterUUID, "Cluster UUID") version = flag.Bool("version", false, "Print the version and exit.") ) flag.Parse() @@ -47,7 +47,7 @@ func main() { authKeys := os.Getenv("YANDEX_AUTH_KEYS") - drv, err := driver.NewDriver(*endpoint, authKeys, *folderID, *driverName, *address, *clusterName) + drv, err := driver.NewDriver(*endpoint, authKeys, *folderID, *driverName, *address, *clusterUUID) if err != nil { log.Fatalln(err) } diff --git a/driver/controller.go b/driver/controller.go index 2ad97cc..9785f8d 100644 --- a/driver/controller.go +++ b/driver/controller.go @@ -173,7 +173,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) FolderId: d.folderID, Name: volumeName, Description: createdByYandex, - Labels: map[string]string{"cluster_uuid": d.clusterName}, + Labels: map[string]string{"cluster_uuid": d.clusterUUID}, TypeId: typeID, ZoneId: zone, Size: size, diff --git a/driver/driver.go b/driver/driver.go index a290681..28b265a 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -48,7 +48,7 @@ const ( // DefaultAddress is the default address that the csi plugin will serve its // http handler on. DefaultAddress = "127.0.0.1:12302" - DefaultClusterName = "default" + DefaultClusterUUID = "default" defaultWaitActionTimeout = 5 * time.Minute ) @@ -78,7 +78,7 @@ type Driver struct { region string zone string - clusterName string + clusterUUID string srv *grpc.Server httpSrv http.Server @@ -111,7 +111,7 @@ func (d *Driver) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi // NewDriver returns a CSI plugin that contains the necessary gRPC // interfaces to interact with Kubernetes over unix domain sockets for // managaing Yandex Disks -func NewDriver(ep, authKeysStr, folderID, driverName, address, clusterName string) (*Driver, error) { +func NewDriver(ep, authKeysStr, folderID, driverName, address, clusterUUID string) (*Driver, error) { ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() @@ -172,7 +172,7 @@ func NewDriver(ep, authKeysStr, folderID, driverName, address, clusterName strin resizeLocks: NewRwMap(), waitActionTimeout: defaultWaitActionTimeout, - clusterName: clusterName, + clusterUUID: clusterUUID, sdk: sdk,