@@ -71,6 +71,7 @@ func setupCaching(devicePath string, req *csi.NodeStageVolumeRequest, nodeId str
71
71
if vgExists {
72
72
// Clean up Volume Group before adding the PD
73
73
reduceVolumeGroup (volumeGroupName , true )
74
+ validateRaidedLSSDinVG (volumeGroupName , raidedLocalSsdPath )
74
75
} else {
75
76
err := createVg (volumeGroupName , raidedLocalSsdPath )
76
77
if err != nil {
@@ -581,33 +582,6 @@ func fetchChunkSizeKiB(cacheSize string) (string, error) {
581
582
return strconv .FormatInt (int64 (chunkSize ), 10 ) + "KiB" , nil
582
583
}
583
584
584
- func InitializeDataCacheNode (nodeId string ) error {
585
- raidedLocalSsdPath , err := fetchRAIDedLocalSsdPath ()
586
- if err != nil {
587
- return err
588
- }
589
- volumeGroupName := getVolumeGroupName (nodeId )
590
-
591
- vgExists := checkVgExists (volumeGroupName )
592
- // Check if the required volume group already exists
593
- if vgExists {
594
- // Clean up Volume Group before adding the PD
595
- reduceVolumeGroup (volumeGroupName , true )
596
-
597
- // validate that raidedLSSD is part of VG
598
- err = validateRaidedLSSDinVG (volumeGroupName , raidedLocalSsdPath )
599
- if err != nil {
600
- return fmt .Errorf ("failed validate local ssd in vg %v: %v" , volumeGroupName , err )
601
- }
602
- } else {
603
- err := createVg (volumeGroupName , raidedLocalSsdPath )
604
- if err != nil {
605
- return err
606
- }
607
- }
608
- return nil
609
- }
610
-
611
585
func StartWatcher (nodeName string ) {
612
586
dirToWatch := "/dev/"
613
587
watcher , err := fsnotify .NewWatcher ()
0 commit comments