Skip to content

Commit

Permalink
Merge pull request #1441 from stgraber/storage
Browse files Browse the repository at this point in the history
incusd/daemon_storage: Ensure corect symlinks for images/backups
  • Loading branch information
hallyn authored Nov 30, 2024
2 parents 34789c0 + 880103a commit a3ddd7b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/incusd/daemon_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ func daemonStorageMount(s *state.State) error {
return fmt.Errorf("Failed to mount storage volume %q: %w", source, err)
}

// Ensure we have the correct symlink in place.
volStorageName := project.StorageVolume(api.ProjectDefaultName, volumeName)

_ = os.RemoveAll(internalUtil.VarPath(storageType))
err = os.Symlink(internalUtil.VarPath("storage-pools", poolName, "custom", volStorageName), internalUtil.VarPath(storageType))
if err != nil {
return fmt.Errorf("Failed to set up symlink for %q: %w", storageType, err)
}

return nil
}

Expand Down

0 comments on commit a3ddd7b

Please sign in to comment.