Skip to content

Commit

Permalink
incusd/daemon_storage: Ensure corect symlinks for images/backups
Browse files Browse the repository at this point in the history
Closes #1426

Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Nov 30, 2024
1 parent 6532073 commit 880103a
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 880103a

Please sign in to comment.