@@ -350,22 +350,21 @@ func removeRcloneConfigFile(configPath, target string) {
350
350
_ , err := os .Stat (configPathWithVolID )
351
351
if err != nil {
352
352
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 )
354
354
return
355
355
}
356
356
klog .Errorf ("removeRcloneConfigFile: Attempt %d - Failed to stat path %s: %v" , retry , configPathWithVolID , err )
357
357
time .Sleep (constants .Interval )
358
358
continue
359
359
}
360
- configFile := path .Join (configPathWithVolID , configFileName )
361
- err = os .Remove (configFile )
360
+ err = RemoveAll (configPathWithVolID )
362
361
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 )
364
363
time .Sleep (constants .Interval )
365
364
continue
366
365
}
367
- klog .Infof ("removeRcloneConfigFile: Successfully removed config file: %s" , configFile )
366
+ klog .Infof ("removeRcloneConfigFile: Successfully removed config file path : %s" , configPathWithVolID )
368
367
return
369
368
}
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 )
371
370
}
0 commit comments