OCI storage: unconditionally remove the old link when link()'ing (#686)

This commit is contained in:
Nikolay Edigaryev
2023-12-08 17:20:49 +04:00
committed by GitHub
parent 02f1ff5238
commit 537f0ae5db
+1 -3
View File
@@ -219,9 +219,7 @@ class VMStorageOCI: PrunableStorage {
}
func link(from: RemoteName, to: RemoteName) throws {
if FileManager.default.fileExists(atPath: vmURL(from).path) {
try FileManager.default.removeItem(at: vmURL(from))
}
try? FileManager.default.removeItem(at: vmURL(from))
try FileManager.default.createSymbolicLink(at: vmURL(from), withDestinationURL: vmURL(to))