@@ -350,22 +350,21 @@ func removeRcloneConfigFile(configPath, target string) {
350350 _ , err := os .Stat (configPathWithVolID )
351351 if err != nil {
352352 if os .IsNotExist (err ) {
353- klog .Infof ("removeRcloneConfigFile: Password file directory does not exist: %s" , configPathWithVolID )
353+ klog .Infof ("removeRcloneConfigFile: Config file directory does not exist: %s" , configPathWithVolID )
354354 return
355355 }
356356 klog .Errorf ("removeRcloneConfigFile: Attempt %d - Failed to stat path %s: %v" , retry , configPathWithVolID , err )
357357 time .Sleep (constants .Interval )
358358 continue
359359 }
360- configFile := path .Join (configPathWithVolID , configFileName )
361- err = os .Remove (configFile )
360+ err = RemoveAll (configPathWithVolID )
362361 if err != nil {
363- klog .Errorf ("removeRcloneConfigFile: Attempt %d - Failed to remove password file %s: %v" , retry , configFile , err )
362+ klog .Errorf ("removeRcloneConfigFile: Attempt %d - Failed to remove config file path %s: %v" , retry , configPathWithVolID , err )
364363 time .Sleep (constants .Interval )
365364 continue
366365 }
367- klog .Infof ("removeRcloneConfigFile: Successfully removed config file: %s" , configFile )
366+ klog .Infof ("removeRcloneConfigFile: Successfully removed config file path : %s" , configPathWithVolID )
368367 return
369368 }
370- klog .Errorf ("removeRcloneConfigFile: Failed to remove config file after %d attempts" , maxRetries )
369+ klog .Errorf ("removeRcloneConfigFile: Failed to remove config file path after %d attempts" , maxRetries )
371370}
0 commit comments