Skip to content

Commit

Permalink
added clusterUUID as label to newly created disks
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanenkoDenys committed Apr 23, 2024
1 parent 0bb4229 commit 50cca08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/yandex-csi-driver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -78,7 +78,7 @@ type Driver struct {
region string
zone string

clusterName string
clusterUUID string

srv *grpc.Server
httpSrv http.Server
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -172,7 +172,7 @@ func NewDriver(ep, authKeysStr, folderID, driverName, address, clusterName strin
resizeLocks: NewRwMap(),
waitActionTimeout: defaultWaitActionTimeout,

clusterName: clusterName,
clusterUUID: clusterUUID,

sdk: sdk,

Expand Down

0 comments on commit 50cca08

Please # to comment.