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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

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))